GNOME Bugzilla – Bug 570283
schema-bindings.c fails to compile
Last modified: 2009-02-03 02:22:00 UTC
When I try to compile Metacity's trunk on a Debian unstable system, it fails with the following error messages: gcc -DHAVE_CONFIG_H -I. -I.. -I./include -DMETACITY_LIBEXECDIR=\"/usr/local/libexec\" -DHOST_ALIAS=\"\" -DMETACITY_LOCALEDIR=\"/usr/local/share/locale\" -DMETACITY_PKGDATADIR=\"/usr/local/share/metacity\" -DMETACITY_DATADIR=\"/usr/local/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/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/directfb -I/usr/include/libpng12 -I/usr/include/pixman-1 -I/usr/include/gconf/2 -I/usr/include/orbit-2.0 -g -O2 -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -Wall -Werror -ansi -MT schema-bindings.o -MD -MP -MF .deps/schema-bindings.Tpo -c -o schema-bindings.o `test -f 'core/schema-bindings.c' || echo './'`core/schema-bindings.c cc1: warnings being treated as errors core/schema-bindings.c: In function ‘produce_bindings’: core/schema-bindings.c:140: error: suggest explicit braces to avoid ambiguous ‘else’ core/schema-bindings.c:144: error: suggest explicit braces to avoid ambiguous ‘else’ make[4]: *** [schema-bindings.o] Error 1 These errors both correspond to if statements that contain a g_error call. g_error expands to G_STMT_START ... G_STMT_END, which expand to "if (1)" and "else (void) 0", respectively. There are other such constructs in this file, but they avoid the problem by using braces around the call to g_error.
Created attachment 127795 [details] [review] Patch
See also bug 507349.
Committed with thanks.