GNOME Bugzilla – Bug 606719
Fails to build with GCC 4.5
Last modified: 2010-04-01 09:55:31 UTC
Metacity fails to build with a trunk version of GCC dated 20100107. This is caused by -Werror stomping on a new warning. cc -DHAVE_CONFIG_H -I. -I.. -I./include -DMETACITY_LIBEXECDIR=\"/usr/lib/metacity\" -DHOST_ALIAS=\"\" -DMETACITY_LOCALEDIR=\"/usr/share/locale\" -DMETACITY_PKGDATADIR=\"/usr/share/metacity\" -DMETACITY_DATADIR=\"/usr/share\" -DG_LOG_DOMAIN=\"metacity\" -DSN_API_NOT_YET_FROZEN=1 -D_REENTRANT -DORBIT2=1 -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/directfb -I/usr/include/libpng12 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gconf/2 -I/usr/include/orbit-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/startup-notification-1.0 -I/usr/include/libgtop-2.0 -g -O2 -g -Wall -O2 -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wsign-compare -Wall -Werror -ansi -c -o window.o `test -f 'core/window.c' || echo './'`core/window.c cc1: warnings being treated as errors core/window.c: In function 'menu_callback': core/window.c:6463:9: error: case value '0' not in enumerated type 'MetaMenuOp' make[5]: *** [window.o] Error 1 The solution is probably to add a META_MENU_OP_NONE = 0 in the enum. I have not checked, but this might also be necessary for some other enums. Note that this also applies to mutter.
Raising the priority since gcc 4.5 will be used in more and more distributions now.
Created attachment 154394 [details] [review] Possible patch A possible patch. I'm not sure if in this case breaking the enum order of MetaMenuOp is of any importance or causes too much trouble.
I committed a patch based on this.
(In reply to comment #3) > I committed a patch based on this. Thanks. Could you commit it to mutter too?
I'll ask Owen.