GNOME Bugzilla – Bug 778495
epiphany-3.20.7 fails to build with gcc-4.9 (due to 'for' loop initial declarations)
Last modified: 2017-04-06 20:24:47 UTC
This is a regression over 3.20.6 x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I.. -I../lib -I./history -DSHARE_DIR=\"/usr/share/epiphany\" -DGETTEXT_PACKAGE=\"epiphany\" -DLOCALEDIR=\"/usr/share/locale\" -pthread -D_REENTRANT -I/usr/include/gtk-3.0/unix-print -I/usr/include/libwnck-3.0 -I/usr/include/startup-notification-1.0 -I/usr/include/webkitgtk-4.0 -I/usr/include/libsoup-2.4 -I/usr/include/libxml2 -I/usr/include/libsecret-1 -I/usr/include/gnome-desktop-3.0 -I/usr/include/gcr-3 -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libdrm -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/gcr-3 -I/usr/include/gck-1 -I/usr/include/p11-kit-1 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/gsettings-desktop-schemas -fno-strict-aliasing -Wall -Wextra -Wundef -Wnested-externs -Wwrite-strings -Wpointer-arith -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wno-unused-parameter -Wno-missing-field-initializers -Wdeclaration-after-statement -Wformat=2 -Wold-style-definition -Wcast-align -Wformat-nonliteral -Wformat-security -Wsign-compare -Wstrict-aliasing -Wshadow -Winline -Wpacked -Wmissing-format-attribute -Wmissing-noreturn -Winit-self -Wmissing-include-dirs -Wunused-but-set-variable -Warray-bounds -Wimplicit-function-declaration -Wreturn-type -Wswitch-enum -Wswitch-default -Wno-deprecated-declarations -Wno-error=unused-parameter -Wno-error=missing-field-initializers -Wno-error=deprecated-declarations -march=native -pipe -O2 -ggdb -c -o ephy_profile_migrator-ephy-profile-migrator.o `test -f 'ephy-profile-migrator.c' || echo './'`ephy-profile-migrator.c ephy-profile-migrator.c: In function 'migrate_insecure_passwords': ephy-profile-migrator.c:1076:3: error: 'for' loop initial declarations are only allowed in C99 or C11 mode for (GList *l = items; l != NULL; l = l->next) ^ ephy-profile-migrator.c:1076:3: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code make[4]: *** [Makefile:923: ephy_profile_migrator-ephy-profile-migrator.o] Error 1 make[4]: Leaving directory '/var/tmp/portage/www-client/epiphany-3.20.7/work/epiphany-3.20.7/lib' make[3]: *** [Makefile:959: all-recursive] Error 1 make[3]: Leaving directory '/var/tmp/portage/www-client/epiphany-3.20.7/work/epiphany-3.20.7/lib' make[2]: *** [Makefile:579: all] Error 2 make[2]: Leaving directory '/var/tmp/portage/www-client/epiphany-3.20.7/work/epiphany-3.20.7/lib' make[1]: *** [Makefile:487: all-recursive] Error 1 make[1]: Leaving directory '/var/tmp/portage/www-client/epiphany-3.20.7/work/epiphany-3.20.7' make: *** [Makefile:419: all] Error 2
Good to know, thanks for reporting. You'll have to build it with CFLAGS="--std=gnu11". I know it's a bit awkward that this isn't handled by the build system. If someone wants to add an AX_C_COMPILE_STDC_* series of macros to autoconf-archive and m4-common to parallel the AX_CXX_COMPILE_STDCXX_* series, then we could set it directly in the build system, but I don't want to keep custom autoconf goo around to do that just for the benefit of GCC 4.9.
Well, then this bug should still be valid and not WONTFIX, just it happens to need build system fixes, not code changes to not use C99 features. As you are saying, relying on implicit -std= set by GCC version is wrong. There is AC_PROG_CC_C99, which shouldn't need any autoconf-archive/m4-common additions.
I'm not going to use AC_PROG_CC_C99. I only test Epiphany using C11.
This is going to be WONTFIX, pending creation of a new autoconf archive macro by someone other than me. Or port to meson.