Compile Fails in qofsession.c
Casey Cichon
casey at wizkid.homelinux.net
Mon Jun 23 14:17:05 EDT 2008
Charles Day wrote:
> On Mon, Jun 23, 2008 at 10:23 AM, Casey Cichon
> <casey at wizkid.homelinux.net <mailto:casey at wizkid.homelinux.net>> wrote:
>
> After a few weeks away from using the development gnucash version to
> upgrade my machine from Fedora 5 to Ubuntu gutsy (soon to be
> hardy). I
> get this when running ....
>
>
> This definitely seems like a bug in the code, since msg could get
> passed to g_free() at line 1351 before it is ever assigned. Shall I go
> ahead and commit a fix?
>
> BEFORE:
> char *msg, *book_id;
>
> AFTER:
> char *msg = NULL;
> char *book_id;
>
> -Charles
>
>
> gcc -DHAVE_CONFIG_H -I. -I. -I../../.. -DG_LOG_DOMAIN=\"qof\"
> -pthread
> -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
> -I../../../lib/libc
> -Werror -Wdeclaration-after-statement -Wno-pointer-sign
> -D_FORTIFY_SOURCE=2 -g -O2 -Wall -Wunused -Wmissing-prototypes
> -Wmissing-declarations -Wno-unused -MT qofutil.lo -MD -MP -MF
> .deps/qofutil.Tpo -c qofutil.c -fPIC -DPIC -o .libs/qofutil.o
> if /bin/bash ../../../libtool --tag=CC --mode=compile gcc
> -DHAVE_CONFIG_H -I. -I. -I../../.. -DG_LOG_DOMAIN=\"qof\" -pthread
> -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
> -I../../../lib/libc -Werror -Wdeclaration-after-statement
> -Wno-pointer-sign -D_FORTIFY_SOURCE=2 -g -O2 -Wall -Wunused
> -Wmissing-prototypes -Wmissing-declarations -Wno-unused -MT
> qofsession.lo -MD -MP -MF ".deps/qofsession.Tpo" -c -o qofsession.lo
> qofsession.c; \
> then mv -f ".deps/qofsession.Tpo" ".deps/qofsession.Plo"; else
> rm -f ".deps/qofsession.Tpo"; exit 1; fi
> gcc -DHAVE_CONFIG_H -I. -I. -I../../.. -DG_LOG_DOMAIN=\"qof\"
> -pthread
> -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
> -I../../../lib/libc
> -Werror -Wdeclaration-after-statement -Wno-pointer-sign
> -D_FORTIFY_SOURCE=2 -g -O2 -Wall -Wunused -Wmissing-prototypes
> -Wmissing-declarations -Wno-unused -MT qofsession.lo -MD -MP -MF
> .deps/qofsession.Tpo -c qofsession.c -fPIC -DPIC -o
> .libs/qofsession.o
> cc1: warnings being treated as errors
> qofsession.c: In function 'qof_session_save':
> qofsession.c:1214: warning: 'msg' may be used uninitialized in
> this function
> make[5]: *** [qofsession.lo] Error 1
> make[5]: Leaving directory
> `/home/casey/downloads/gnucash/lib/libqof/qof'
> make[4]: *** [all] Error 2
> make[4]: Leaving directory
> `/home/casey/downloads/gnucash/lib/libqof/qof'
> make[3]: *** [all-recursive] Error 1
> make[3]: Leaving directory `/home/casey/downloads/gnucash/lib/libqof'
> make[2]: *** [all-recursive] Error 1
> make[2]: Leaving directory `/home/casey/downloads/gnucash/lib'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/home/casey/downloads/gnucash'
> make: *** [all] Error 2
> casey at wizkid2:~/downloads/gnucash$
>
>
> i used the following configure line ....
> ./configure --enable-compile-warnings --enable-ofx --enable-doxygen
>
> is something broke that I just missed in the emails.
>
> Casey Cichon
>
> _______________________________________________
> gnucash-devel mailing list
> gnucash-devel at gnucash.org <mailto:gnucash-devel at gnucash.org>
> https://lists.gnucash.org/mailman/listinfo/gnucash-devel
>
>
I would think the char *msg = NULL; would work ... since the message
says that it might never get assigned.
Casey
More information about the gnucash-devel
mailing list