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 705331 - AM_PATH_GLIB_2_0 macro fails with -Wstrict-prototypes -Werror
AM_PATH_GLIB_2_0 macro fails with -Wstrict-prototypes -Werror
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: build
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2013-08-02 08:48 UTC by Akira TAGOH
Modified: 2017-10-26 11:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
build: Fix -Wstrict-prototypes warning in glib-2.0.m4 (684 bytes, patch)
2017-10-24 10:30 UTC, Philip Withnall
committed Details | Review

Description Akira TAGOH 2013-08-02 08:48:10 UTC
Summary says that all. here is the log from config.log:

configure:17342: gcc -o conftest -g -O2  -Wall -Wstrict-prototypes -Wnested-externs -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -Wer
ror=format=2 -Werror=missing-include-dirs -Werror    conftest.c  >&5
conftest.c:28:1: error: function declaration isn't a prototype [-Werror=strict-prototypes]
 main ()
 ^
cc1: all warnings being treated as errors
Comment 1 Colin Walters 2013-08-03 12:20:36 UTC
If you maintain a program which sets default CFLAGS, I strongly recommend setting CFLAGS at the *end* of your configure.ac.  Or better, don't set CFLAGS at all in configure; instead, set a separate variable like WARN_CFLAGS, and ensure that ends up in your makefiles.  Like:

https://git.gnome.org/browse/ostree/tree/configure.ac#n16
https://git.gnome.org/browse/ostree/tree/Makefile.am#n23

If you are a system builder (dpkg/openembedded/rpm/etc.) trying to inject -Werror from the outside, you're just asking for pain.  

That all said, we should make the m4 macros handle this; care to do a patch?
Comment 2 Philip Withnall 2017-10-24 10:30:02 UTC
Created attachment 362172 [details] [review]
build: Fix -Wstrict-prototypes warning in glib-2.0.m4

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Comment 3 Matthias Clasen 2017-10-26 11:09:39 UTC
Review of attachment 362172 [details] [review]:

sure
Comment 4 Philip Withnall 2017-10-26 11:25:53 UTC
Attachment 362172 [details] pushed as 3a3af3d - build: Fix -Wstrict-prototypes warning in glib-2.0.m4