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 770103 - libcheck: fails to compile with mingw due to strsignal prototype mismatch
libcheck: fails to compile with mingw due to strsignal prototype mismatch
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
1.8.2
Other Windows
: Normal major
: 1.8.4
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-08-18 17:19 UTC by Philippe Renon
Modified: 2016-09-26 10:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix strsignla function prototype to match actual declaration (816 bytes, patch)
2016-08-18 17:19 UTC, Philippe Renon
none Details | Review
fix strsignal function declaration to match prtotype (668 bytes, patch)
2016-08-23 10:12 UTC, Philippe Renon
none Details | Review

Description Philippe Renon 2016-08-18 17:19:14 UTC
Created attachment 333576 [details] [review]
fix strsignla function prototype to match actual declaration

strsignal prototype declares a return type of char* but implementation actually returns a const char*.
Comment 1 Sebastian Dröge (slomo) 2016-08-18 18:10:00 UTC
Comment on attachment 333576 [details] [review]
fix strsignla function prototype to match actual declaration

This reverts another commit:

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
    
    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.
    
    [1] man 3 strsignal
    
    https://bugzilla.gnome.org/show_bug.cgi?id=763567
Comment 2 Sebastian Dröge (slomo) 2016-08-18 18:10:22 UTC
On which system does this fail to compile, which libc, version which?
Comment 3 Anthony G. Basile 2016-08-18 23:15:29 UTC
With commit c9da8b0e, this builds on glibc, uclibc and musl.  I've tested on those.  If its failing on some other libc, we should look at whether or not they are POSIX compliant.
Comment 4 Philippe Renon 2016-08-19 11:28:50 UTC
Compilation error happens with msys2 / mingw.
Comment 5 Philippe Renon 2016-08-19 11:33:22 UTC
I chose to remove the const from the prototype.
Would adding it to the method definition (as mentionned in https://bugzilla.gnome.org/show_bug.cgi?id=763567) work ?
Comment 6 Anthony G. Basile 2016-08-19 20:19:05 UTC
(In reply to Philippe Renon from comment #5)
> I chose to remove the const from the prototype.
> Would adding it to the method definition (as mentionned in
> https://bugzilla.gnome.org/show_bug.cgi?id=763567) work ?

This is preferable and I should probably have done that in the original commit.  Can you let us know if it works for mingw and I'll test your patch on the other libcs.
Comment 7 Philippe Renon 2016-08-23 10:12:57 UTC
Created attachment 333981 [details] [review]
fix strsignal function declaration to match prtotype
Comment 8 Philippe Renon 2016-08-23 17:20:07 UTC
I replaced the previous patch with a new one that changes the method declaration.
Compiles fine with mingw.
Comment 9 Philippe Renon 2016-09-25 09:11:10 UTC
Any news ?
Comment 10 Tim-Philipp Müller 2016-09-25 20:58:32 UTC
I'm confused.

Just to confirm:

 - this works fine in master / 1.9.x, yes?
 - it needs fixing in the 1.8 branch
 - basically we just need to cherry-pick commit c9da8b0e7 into 1.8, no?
Comment 11 Philippe Renon 2016-09-26 05:50:05 UTC
The issue affects branch 1.8 on msys2.

Master seems fine.

The link to the proposed cherry-pick leads nowhere.
Comment 13 Philippe Renon 2016-09-26 06:45:03 UTC
Yes, that commit does the same as the attached patch and needs to be cherry-picked in the 1.8 branch.
Comment 14 Tim-Philipp Müller 2016-09-26 10:02:09 UTC
Ok, thanks for confirming. Fixed in 1.8 branch now as well.