GNOME Bugzilla – Bug 588456
test-resizing.c incorrect code causes FTBFS with -O3
Last modified: 2015-04-15 13:43:55 UTC
test-resizing.c contains the following code in get_size(): if (widthp) *widthp = width; if (*heightp) *heightp = height; While the widthp check correctly checks the _pointer_ for non-NULL, the heightp check is against the _value_. gcc with -O3 catches this mistake and aborts because of -Werror: gcc -DHAVE_CONFIG_H -I. -I../.. -D_REENTRANT -I/home/sugar/sugar-jhbuild/install/include/gconf/2 -I/home/sugar/sugar-jhbuild/install/include /dbus-1.0 -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/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/ dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/startup-notification-1.0 -O3 -ggdb -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -Wall -Werror -ansi -MT test-resizing.o -MD -MP -MF .deps/ test-resizing.Tpo -c -o test-resizing.o test-resizing.c cc1: warnings being treated as errors test-resizing.c: In function ‘main’: test-resizing.c:82: error: ‘height’ is used uninitialized in this function test-resizing.c:94: note: ‘height’ was declared here make[4]: *** [test-resizing.o] Error 1 make[4]: Leaving directory `/home/sugar/sugar-jhbuild/source/metacity/src/wm-tester'
Created attachment 143816 [details] [review] fix typo in test-resizing.c