GNOME Bugzilla – Bug 705331
AM_PATH_GLIB_2_0 macro fails with -Wstrict-prototypes -Werror
Last modified: 2017-10-26 11:25:58 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
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?
Created attachment 362172 [details] [review] build: Fix -Wstrict-prototypes warning in glib-2.0.m4 Signed-off-by: Philip Withnall <withnall@endlessm.com>
Review of attachment 362172 [details] [review]: sure
Attachment 362172 [details] pushed as 3a3af3d - build: Fix -Wstrict-prototypes warning in glib-2.0.m4