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 729001 - Compile broken after merge of branch 'c++-build'
Compile broken after merge of branch 'c++-build'
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Engine
git-master
Other Linux
: Normal normal
: ---
Assigned To: gnucash-core-maint
gnucash-core-maint
Depends on:
Blocks:
 
 
Reported: 2014-04-26 07:52 UTC by Michalis
Modified: 2018-06-29 23:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Puts the warnings in AM_CFLAGS so that they're not applied when overriding. (3.16 KB, patch)
2014-04-26 17:18 UTC, John Ralls
none Details | Review
Back off on -Wextra. Forgot that it's too picky. (17.39 KB, patch)
2014-04-26 17:43 UTC, John Ralls
rejected Details | Review
The right patch this time! (3.15 KB, patch)
2014-04-26 18:18 UTC, John Ralls
committed Details | Review

Description Michalis 2014-04-26 07:52:35 UTC
In Ubuntu 13.10
after autogen.sh, configure --enable-compile-warnings, make
I get the message:

make[1]: Entering directory `/home/michalis/git/gnucash/src/libqof/qof'
/bin/bash ../../../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../..  -I../../../lib/libc -I../../../src -pthread -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include   -DG_LOG_DOMAIN=\"qof\"  -xc++ -Werror -Wdeclaration-after-statement -g -O2 -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations  -Wno-unused -MT libgnc_qof_la-gnc-date.lo -MD -MP -MF .deps/libgnc_qof_la-gnc-date.Tpo -c -o libgnc_qof_la-gnc-date.lo `test -f 'gnc-date.c' || echo './'`gnc-date.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../../.. -I../../../lib/libc -I../../../src -pthread -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include -DG_LOG_DOMAIN=\"qof\" -xc++ -Werror -Wdeclaration-after-statement -g -O2 -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wno-unused -MT libgnc_qof_la-gnc-date.lo -MD -MP -MF .deps/libgnc_qof_la-gnc-date.Tpo -c gnc-date.c  -fPIC -DPIC -o .libs/libgnc_qof_la-gnc-date.o
cc1plus: error: command line option '-Wdeclaration-after-statement' is valid for C/ObjC but not for C++ [-Werror]
cc1plus: error: command line option '-Wmissing-prototypes' is valid for C/ObjC but not for C++ [-Werror]
cc1plus: all warnings being treated as errors
make[1]: *** [libgnc_qof_la-gnc-date.lo] Error 1
make[1]: Leaving directory `/home/michalis/git/gnucash/src/libqof/qof'
make: *** [all-recursive] Error 1
Comment 1 Geert Janssens 2014-04-26 09:02:38 UTC
Confirmed on Fedora 20 as well. Compiler is gcc/g++ 4.8.2.

I guess John is compiling with clang.
Comment 2 Herbert Thoma 2014-04-26 10:16:26 UTC
Confirmed for OpenSUSE 12.3 as well (gcc (SUSE Linux) 4.7.2 20130108 [gcc-4_7-branch revision 195012])
Comment 3 John Ralls 2014-04-26 17:18:32 UTC
Created attachment 275222 [details] [review]
Puts the warnings in AM_CFLAGS so that they're not applied when overriding.

Mike Alexander, is this the direction you took as well?
Comment 4 John Ralls 2014-04-26 17:43:29 UTC
Created attachment 275223 [details] [review]
Back off on -Wextra. Forgot that it's too picky.
Comment 5 John Ralls 2014-04-26 18:15:23 UTC
Comment on attachment 275223 [details] [review]
Back off on -Wextra. Forgot that it's too picky.

Oops, wrong patch.
Comment 6 John Ralls 2014-04-26 18:18:18 UTC
Created attachment 275225 [details] [review]
The right patch this time!


I've gone ahead and pushed this along with another commit with more warning-fixes. master now compiles and completes make check on F18.
Comment 7 Geert Janssens 2014-04-26 18:55:44 UTC
Qof build is fixed with this patch, thanks!

But now I'm getting loads of these in engine/test:
/kobaltnet/janssege/Development/EclipseGnuCash/GnuCash-git/src/engine/test/utest-Split.c: In function 'void test_xaccSplitEqualCheckBal(Fixture*, gconstpointer)':
/kobaltnet/janssege/Development/EclipseGnuCash/GnuCash-git/src/engine/test/utest-Split.c:395:18: warning: deprecated conversion from string constant to 'gchar* {aka char*}' [-Wwrite-strings]
     gchar *msg = "[xaccSplitEqualCheckBal] test balances differ: 123/100 vs 456/100";
                  ^
/kobaltnet/janssege/Development/EclipseGnuCash/GnuCash-git/src/engine/test/utest-Split.c:398:62: warning: deprecated conversion from string constant to 'gchar* {aka char*}' [-Wwrite-strings]
     TestErrorStruct check = { loglevel, "gnc.engine", msg, 0 };
Comment 8 Michalis 2014-04-26 19:16:41 UTC
Ubuntu 13.10 
gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1

I'm getting no errors on Qof build.
I'm getting the same errors as Geert on engine tests.
And I cannot finish the build with that error:


libtool: link: gcc -Werror -Wdeclaration-after-statement -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wno-unused -g -O2 -o .libs/gnucash gnucash-bin.o -pthread -Wl,--export-dynamic  ../../src/register/ledger-core/.libs/libgncmod-ledger-core.so ../../src/report/report-gnome/.libs/libgncmod-report-gnome.so ../../src/gnome/.libs/libgnc-gnome.so ../../src/gnome-utils/.libs/libgncmod-gnome-utils.so ../../src/app-utils/.libs/libgncmod-app-utils.so ../../src/engine/.libs/libgncmod-engine.so ../../src/gnc-module/.libs/libgnc-module.so ../../src/core-utils/.libs/libgnc-core-utils.so ../../src/libqof/qof/.libs/libgnc-qof.so -lguile -lgmp -lcrypt /usr/lib/i386-linux-gnu/libltdl.so -lgthread-2.0 -lgmodule-2.0 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 /usr/lib/i386-linux-gnu/libcairo.so -lpango-1.0 /usr/lib/i386-linux-gnu/libfreetype.so -lfontconfig -lgobject-2.0 -lglib-2.0 -lprofiler -lm -pthread -Wl,-rpath -Wl,/usr/local/lib/gnucash
/usr/bin/ld: cannot find -lprofiler
collect2: error: ld returned 1 exit status
make[4]: *** [gnucash] Error 1
make[4]: Leaving directory `/home/michalis/git/gnucash/src/bin'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/michalis/git/gnucash/src/bin'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/michalis/git/gnucash/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/michalis/git/gnucash'
make: *** [all] Error 2

I have no idea which profiler library is needed, probably something is missing from my system, but it wasn't there before.
Comment 9 Geert Janssens 2014-04-27 09:08:12 UTC
The last set of fixes fixes the build again. GnuCash runs fine, with its first set of plastic c++ surgery in place. Yay!

I did have to start from a clean build directory. Perhaps make maintainer-clean/autogen.sh/configure.sh would have worked as well but it seems to me that takes just as long.
Comment 10 Mike Evans 2014-04-27 10:39:45 UTC
Successful compile this morning on FC18.  

Did:
make distclean
git clean -f
./autogen.sh
./configure $MYOPTIONS
make install

Happiness.
Comment 11 Herbert Thoma 2014-04-27 12:10:58 UTC
Works with OpenSUSE 12.3 as well. I guess this bug can be closed as fixed.
Comment 12 Geert Janssens 2014-04-27 13:45:27 UTC
Closed.
Comment 13 John Ralls 2018-06-29 23:30:25 UTC
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=729001. Please update any external references or bookmarks.