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 616274 - mutter from git fails with gcc 4.5 (on new warning)
mutter from git fails with gcc 4.5 (on new warning)
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
git master
Other Linux
: Normal blocker
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2010-04-20 11:29 UTC by Maciej (Matthew) Piechotka
Modified: 2010-04-26 21:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[PATCH] Fix warning on gcc 4.5 about 0 not belonging to enum (1.46 KB, patch)
2010-04-20 11:41 UTC, Maciej (Matthew) Piechotka
none Details | Review
[PATCH] Fix warning on gcc 4.5 about 0 not belonging to enum (7.21 KB, patch)
2010-04-20 11:55 UTC, Maciej (Matthew) Piechotka
none Details | Review

Description Maciej (Matthew) Piechotka 2010-04-20 11:29:38 UTC
x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I.. -pthread -DORBIT2=1 -D_REENTRANT -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gconf/2 -I/usr/include/orbit-2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/startup-notification-1.0 -I/usr/include/clutter-1.0 -I/usr/include/json-glib-1.0 -I/usr/include/drm -I/usr/include/libdrm -I/usr/include/gobject-introspection-1.0 -I/usr/lib64/libffi-3.0.9/include   -I ./include -I./compositor -DMUTTER_LIBEXECDIR=\"/usr/libexec\" -DHOST_ALIAS=\"x86_64-pc-linux-gnu\" -DMUTTER_LOCALEDIR=\"/usr/share/locale\" -DMUTTER_PKGDATADIR=\"/usr/share/mutter\" -DMUTTER_DATADIR=\"/usr/share\" -DG_LOG_DOMAIN=\"mutter\" -DSN_API_NOT_YET_FROZEN=1 -DMUTTER_MAJOR_VERSION=2 -DMUTTER_MINOR_VERSION=29 -DMUTTER_MICRO_VERSION=1 -DMUTTER_PLUGIN_API_VERSION=3 -DMUTTER_PKGLIBDIR=\"/usr/lib64/mutter\" -DMUTTER_PLUGIN_DIR=\"/usr/lib64/mutter/plugins\"    -O2 -pipe -ggdb -march=native -msahf -mcx16 -fgcse-sm -fgcse-las -fgcse-after-reload -ftracer -floop-interchange -floop-strip-mine -floop-block -floop-parallelize-all -ftree-parallelize-loops=2 -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -Wall -Werror -ansi -MT window.o -MD -MP -MF .deps/window.Tpo -c -o window.o `test -f 'core/window.c' || echo './'`core/window.c
mv -f .deps/window-props.Tpo .deps/window-props.Po
x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I.. -pthread -DORBIT2=1 -D_REENTRANT -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gconf/2 -I/usr/include/orbit-2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/startup-notification-1.0 -I/usr/include/clutter-1.0 -I/usr/include/json-glib-1.0 -I/usr/include/drm -I/usr/include/libdrm -I/usr/include/gobject-introspection-1.0 -I/usr/lib64/libffi-3.0.9/include   -I ./include -I./compositor -DMUTTER_LIBEXECDIR=\"/usr/libexec\" -DHOST_ALIAS=\"x86_64-pc-linux-gnu\" -DMUTTER_LOCALEDIR=\"/usr/share/locale\" -DMUTTER_PKGDATADIR=\"/usr/share/mutter\" -DMUTTER_DATADIR=\"/usr/share\" -DG_LOG_DOMAIN=\"mutter\" -DSN_API_NOT_YET_FROZEN=1 -DMUTTER_MAJOR_VERSION=2 -DMUTTER_MINOR_VERSION=29 -DMUTTER_MICRO_VERSION=1 -DMUTTER_PLUGIN_API_VERSION=3 -DMUTTER_PKGLIBDIR=\"/usr/lib64/mutter\" -DMUTTER_PLUGIN_DIR=\"/usr/lib64/mutter/plugins\"    -O2 -pipe -ggdb -march=native -msahf -mcx16 -fgcse-sm -fgcse-las -fgcse-after-reload -ftracer -floop-interchange -floop-strip-mine -floop-block -floop-parallelize-all -ftree-parallelize-loops=2 -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -Wall -Werror -ansi -MT workspace.o -MD -MP -MF .deps/workspace.Tpo -c -o workspace.o `test -f 'core/workspace.c' || echo './'`core/workspace.c
cc1: warnings being treated as errors
core/window.c: In function 'menu_callback':
core/window.c:7160:9: error: case value '0' not in enumerated type 'MetaMenuOp'
make[4]: *** [window.o] Error 1
make[4]: *** Waiting for unfinished jobs....
mv -f .deps/workspace.Tpo .deps/workspace.Po
make[4]: Leaving directory `/var/tmp/paludis/x11-wm-mutter-9999/work/mutter-9999/src'
make[3]: Leaving directory `/var/tmp/paludis/x11-wm-mutter-9999/work/mutter-9999/src'
make[2]: Leaving directory `/var/tmp/paludis/x11-wm-mutter-9999/work/mutter-9999/src'
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: Leaving directory `/var/tmp/paludis/x11-wm-mutter-9999/work/mutter-9999'
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

PS. I'm not sure if hardcoding -Werror, even into git, is good idea as it will fall for alpha testers when they use different compiler then developers (expecially in case of gnome-shell stack when the last release is usually obsolete and unsupported).
Comment 1 Maciej (Matthew) Piechotka 2010-04-20 11:41:12 UTC
Created attachment 159153 [details] [review]
[PATCH] Fix warning on gcc 4.5 about 0 not belonging to enum

Patch fixing the issue. Changes slightly 'API' (as in gir and other warnings).
Comment 2 Maciej (Matthew) Piechotka 2010-04-20 11:55:15 UTC
Created attachment 159155 [details] [review]
[PATCH] Fix warning on gcc 4.5 about 0 not belonging to enum

Another patch. Less intrusive changes but changes the layout locally(especially what git format-patch done with it). Also it assumes that enum can be casted safely on int.
Comment 3 Maciej (Matthew) Piechotka 2010-04-20 12:02:43 UTC
PS. Simple (MetaMenuOp)0 does not work - it was my first idea.
Comment 4 Maciej (Matthew) Piechotka 2010-04-20 12:10:21 UTC
I forgit:
Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.5.0/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.5.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/paludis/sys-devel-gcc-4.5.0/work/gcc-4.5.0/configure --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.5.0 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.0/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.0 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.0/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.0/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.0/include/g++-v4 --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec --disable-fixed-point --with-ppl --with-cloog --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --enable-secureplt --enable-multilib --enable-libmudflap --disable-libssp --enable-libgomp --enable-cld --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.5.0/python --disable-libgcj --enable-objc-gc --enable-languages=c,c++,objc,obj-c++,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.5.0' --enable-lto
Thread model: posix
gcc version 4.5.0 (Gentoo 4.5.0)
Comment 5 Owen Taylor 2010-04-20 13:45:02 UTC
This has already been fixed in Metacity, with an approach along the lines of the first patch, and it's probably best just to be consistent and use that Metacity patch, though I'd have come up with something more like your second patch.

Apr 01 05:56:21 <vuntz> owen: okay to push http://git.gnome.org/browse/metacity/commit/?id=333446ab5f6b773b4c8357a302d80155e8851d22 to mutter?
Apr 01 07:04:14 <owen>  vuntz: what does it mean to get a menu callback with a callback of "none" ?
Apr 01 07:08:48 <owen>  vuntz: I'm not thrilled with the patch, but if you've committed it like that to metacity, it's ok for mutter as well
Apr 01 07:09:45 <owen>  I'd have just handled 0 outside the switch (though I still don't immediately see how you get there with an op of 0)
Apr 05 13:22:19 <owen>  vuntz: on the mutter patch you wanted to push last week, see also https://bugzilla.gnome.org/show_bug.cgi?id=614592 - it's a follow-on fix fixing a crasher in the first patch
Comment 6 Owen Taylor 2010-04-26 21:07:13 UTC
Metacity changes cherry-picked and pushed.