[gcompris-devel] problem compiling gcomprixogoo
Bill Bogstad
bogstad at pobox.com
Fri Jul 24 03:28:59 UTC 2009
I've been trying to compile various versions of gcompris under Ubuntu
8.04 off and on for a while now. I've been able to compile 8.4.12
successfully, but I've ran into a problem with the current head of
gcomprixogoo:
commit 10f0529c02b5d88a2e177860002135745ce04bbe
Author: Bruno Coudoin <bruno.coudoin at free.fr>
Date: Mon Jul 13 15:01:09 2009 +0200
Create the ChangeLog automatically from git log.
After dealing with a number of dependency issues, the compilation
eventually dies as follows:
..........
gcc -DHAVE_CONFIG_H -I. -I../.. -I../../src -I../../intl
-I../../src/goocanvas/src -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/libpng12 -I/usr/include/pixman-1
-I/usr/include/gstreamer-0.10 -I/usr/include/libxml2
-I/usr/include/librsvg-2 -I/usr/include/libxml2 -g -O2 -Wall -Werror
-MT target.lo -MD -MP -MF .deps/target.Tpo -c target.c -fPIC -DPIC -o
.libs/target.o
cc1: warnings being treated as errors
target.c: In function ‘animate_items’:
target.c:607: warning: ‘points’ may be used uninitialized in this function
target.c:607: note: ‘points’ was declared here
make[4]: *** [target.lo] Error 1
make[4]: Leaving directory
`/home/bogstad/software/gcompris/gcompris.git/src/target-activity'
I've taken a look at the code and I think the problem is actually
related to add_points(). A local variable points is created which
could be returned uninitialized if the diametre < targetDefinition is
always false. GCC can't tell if this ever happens and assumes that
add_points returns a random value. The thing is that add_points is
only called from animate_items which promptly discards the return
value of add_points anyway so in some sense it doesn't matter. On the
other hand, the same code in 8.4.12 declares add_points() as void.
It's not clear why the change to return an unused value was made in
the source code in the first place.
Git blame seems seems to show the following:
c682a381 src/target-activity/target.c (Bruno Coudoin 2009-01-18
23:28:50 +0000 607) .....
as the commit that introduced the change. Are there some pending
changes which will cause the return value of add_point() to matter?
In the meantime, can someone suggest how to change the configuration
system to not pass -Werror on the command line to gcc so it will
ignore (this apparently
spurious warning) rather then treat it as an error and exit.
Thanks,
Bill Bogstad
More information about the Gcompris-devel
mailing list