After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 763567 - libcompat.h: strsignal() should not be declared const
libcompat.h: strsignal() should not be declared const
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Mac OS
: Normal normal
: 1.9.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-03-13 15:06 UTC by Anthony G. Basile
Modified: 2016-08-18 18:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
libcompat.h: strsignal() should be not be decleared const (1.06 KB, patch)
2016-03-13 15:06 UTC, Anthony G. Basile
committed Details | Review

Description Anthony G. Basile 2016-03-13 15:06:08 UTC
Created attachment 323793 [details] [review]
libcompat.h: strsignal() should be not be decleared const

POSIX standards requires strsignal() to return a pointer to a char, not a const pointer to a char. [1]  On uClibc, and possibly other libc's, that do not HAVE_DECL_STRSIGNAL, libcompat.h declares const char *strsignal (int sig) which causes a type error.
Comment 1 Anthony G. Basile 2016-03-13 15:12:02 UTC
Downstream bug https://bugs.gentoo.org/show_bug.cgi?id=577312
Comment 2 Sebastian Dröge (slomo) 2016-03-13 15:59:10 UTC
I think we actually also need to copy these two lines to configure.ac:
https://github.com/libcheck/check/blob/master/configure.ac#L295

Can you also provide this patch to libcheck? Thanks!
Comment 3 Anthony G. Basile 2016-03-19 20:47:02 UTC
(In reply to Sebastian Dröge (slomo) from comment #2)
> I think we actually also need to copy these two lines to configure.ac:
> https://github.com/libcheck/check/blob/master/configure.ac#L295
> 
> Can you also provide this patch to libcheck? Thanks!

Sorry for the delay in responding.  I didn't know that that code was coming from libcheck.  So yes, you need those lines from their configure.ac and the fix for libcompat's strsignal() should go to libcheck first and then get imported into gstreamer.
Comment 4 Anthony G. Basile 2016-03-21 13:07:41 UTC
Pull request send to check on github: https://github.com/libcheck/check/pull/24
Comment 5 Anthony G. Basile 2016-03-22 22:38:19 UTC
(In reply to Anthony G. Basile from comment #4)
> Pull request send to check on github:
> https://github.com/libcheck/check/pull/24

The fix was merged upstream in libcheck.  Note that there was a typo in AC_CHECK_DECLS so you don't want to reproduce that when you copy that line to gstreamer.
Comment 6 Sebastian Dröge (slomo) 2016-03-23 12:51:30 UTC
Comment on attachment 323793 [details] [review]
libcompat.h: strsignal() should be not be decleared const

Attachment 323793 [details] pushed as d6e25dd - libcompat.h: strsignal() should be not be decleared const
Comment 7 Sebastian Dröge (slomo) 2016-03-23 12:51:54 UTC
Now someone just has to write the configure part of this.
Comment 8 Jake Foytik 2016-04-29 19:41:31 UTC
I think we also need to remove the const declaration in gst/check/libcheck/strsignal.c . I had an issue when compiling 1.8.1 with mingw that is resolved by removing the 'const'.
Comment 9 Tim-Philipp Müller 2016-04-29 19:47:40 UTC
Yes, didn't I push a patch for this? I know i have it somewhere, let me find it and push it.
Comment 10 Anthony G. Basile 2016-04-30 13:37:21 UTC
Does someone need me to make a patch as mentioned in comment 7?  Its easy, you just have to add the two lines in comment 2.

BTW, why is gstreamer bundling libcheck rather than just depend on it and check for some function in libcheck in configure.ac with AC_SEARCH_LIBS().
Comment 11 Tim-Philipp Müller 2016-05-07 10:55:42 UTC
commit c9da8b0e7f53005ab125e48165dae39fbfee2352
Author: Anthony G. Basile <blueness@gentoo.org>
Date:   Sun Mar 13 11:05:29 2016 -0400

    libcompat.h: strsignal() should be not be decleared const
Comment 12 Anthony G. Basile 2016-05-10 23:35:58 UTC
(In reply to Tim-Philipp Müller from comment #11)
> commit c9da8b0e7f53005ab125e48165dae39fbfee2352
> Author: Anthony G. Basile <blueness@gentoo.org>
> Date:   Sun Mar 13 11:05:29 2016 -0400
> 
>     libcompat.h: strsignal() should be not be decleared const

The gstreamer commit at

https://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=c9da8b0e7f53005ab125e48165dae39fbfee2352

does not match the libcheck commit at

https://github.com/libcheck/check/commit/ab9bddc96dc604b3c396f77b059a403b97a9dbe3

You're missing the hunk for lib/libcompat.h
Comment 13 Tim-Philipp Müller 2016-05-10 23:41:11 UTC
I think it's the other way round - we fixed that already but forgot this hunk?

f1df7aba (Sebastian Rasmussen 2014-11-15 12:53:32 +0100 103) #if !HAVE_DECL_STRSIGNAL
d6e25dde (Anthony G. Basile   2016-03-13 11:05:29 -0400 104) CK_DLL_EXP char *strsignal (int sig);
f1df7aba (Sebastian Rasmussen 2014-11-15 12:53:32 +0100 105) #endif /* !HAVE_DECL_STRSIGNAL */
Comment 14 Anthony G. Basile 2016-05-10 23:51:48 UTC
(In reply to Tim-Philipp Müller from comment #13)
> I think it's the other way round - we fixed that already but forgot this
> hunk?
> 

oh i see what you did. sorry for the noise.
Comment 15 Sebastian Dröge (slomo) 2016-08-18 18:10:30 UTC
See https://bugzilla.gnome.org/show_bug.cgi?id=770103