gnucash master: Multiple changes pushed

Geert Janssens janssens-geert at telenet.be
Thu Jul 3 13:25:59 EDT 2014


On Thursday 03 July 2014 18:04:25 Geert Janssens wrote:
> On Thursday 03 July 2014 17:51:42 John Ralls wrote:
> > On Jul 3, 2014, at 4:16 PM, Geert Janssens <janssens-geert at telenet.be> wrote:
> > > On Thursday 03 July 2014 16:09:28 John Ralls wrote:
> > > > On Jul 3, 2014, at 3:58 PM, Geert Janssens <janssens-geert at telenet.be> wrote:
> > > > > Hmm, my previous mail got truncated by the list server
> > > > > for some reason. Anyway the errors continue for a while
> > > > > with yet more undefined references to std::xyz functions.
> > > > > 
> > > > > This was with a clean autogen/configure/make sequence
> > > > > in an empty build directory.
> > > > > 
> > > > > If I do the same with gcc it works fine.
> > > > 
> > > > Interesting. What version of Clang? What happens if you add
> > > > -stdlib=libstdc++ to CXXFLAGS?
> > > > 
> > > > Regards,
> > > > John Ralls
> > > 
> > > $ clang --version
> > > clang version 3.4 (tags/RELEASE_34/final)
> > > Target: x86_64-redhat-linux-gnu
> > > Thread model: posix
> > > 
> > > I have appended "CXXFLAGS=-stdlib=libstdc++" (without the quotes)
> > > to
> > > my configure run. The error I get now is:
> > > 
> > > /bin/sh ../../../../libtool  --tag=CXX   --mode=link clang -Werror
> > > -Wall -Wno-unused -Wno-deprecated-register -stdlib=libstdc++
> > > -std=gnu++11 -g   -g  -o test-qof test_qof-test-gnc-date.o
> > > test_qof-test-qof.o test_qof-test-qofbook.o
> > > test_qof-test-qofinstance.o test_qof-test-kvp_frame.o
> > > test_qof-test-qofobject.o test_qof-test-qofsession.o
> > > test_qof-test-qof-string-cache.o test_qof-test-gnc-guid.o
> > > test_qof-unittest-support.o
> > > ../../../../src/libqof/qof/libgnc-qof.la -lgio-2.0 -lgthread-2.0
> > > -pthread -lgobject-2.0 -Wl,--export-dynamic -lgmodule-2.0 -pthread
> > > -lglib-2.0  -lm libtool: link: clang -Werror -Wall -Wno-unused
> > > -Wno-deprecated-register -stdlib=libstdc++ -std=gnu++11 -g -g -o
> > > .libs/test-qof test_qof-test-gnc-date.o test_qof-test-qof.o
> > > test_qof-test-qofbook.o test_qof-test-qofinstance.o
> > > test_qof-test-kvp_frame.o test_qof-test-qofobject.o
> > > test_qof-test-qofsession.o test_qof-test-qof-string-cache.o
> > > test_qof-test-gnc-guid.o test_qof-unittest-support.o -pthread
> > > -Wl,--export-dynamic -pthread
> > > ../../../../src/libqof/qof/.libs/libgnc-qof.so -L/usr/lib64
> > > -lgio-2.0 -lgthread-2.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lm
> > > -pthread -Wl,-rpath
> > > -Wl,/home/janssege/Development/Installs/gnucash-f20-master/lib64
> > > clang: error: argument unused during compilation:
> > > '-stdlib=libstdc++' make[5]: *** [test-qof] Error 1
> > > make[5]: Leaving directory
> > > `/kobaltnet/janssege/Development/Builds/gnucash-f20-master/src/lib
> > > q
> > > of/qof/test' make[4]: *** [all-recursive] Error 1
> > > make[4]: Leaving directory
> > > `/kobaltnet/janssege/Development/Builds/gnucash-f20-master/src/lib
> > > q
> > > of/qof' make[3]: *** [all-recursive] Error 1
> > > make[3]: Leaving directory
> > > `/kobaltnet/janssege/Development/Builds/gnucash-f20-master/src/lib
> > > q
> > > of' make[2]: *** [all-recursive] Error 1
> > > make[2]: Leaving directory
> > > `/kobaltnet/janssege/Development/Builds/gnucash-f20-master/src'
> > > make[1]: *** [all-recursive] Error 1
> > > make[1]: Leaving directory
> > > `/kobaltnet/janssege/Development/Builds/gnucash-f20-master' make:
> > > *** [all] Error 2
> > 
> > Oh, well. Seems libc++ is working only on OSX, so it's still
> > libstdc++ on Linux, so that's not it... or maybe it is. The
> > libstdc++ shipped with Xcode is the last GPLV2 one and doesn't
> > support C++11, so I can't test against it to see if that's the
> > problem.
> > 
> > Maybe this is the problem:
> > https://bbs.archlinux.org/viewtopic.php?id=135667 Apparently clang
> > isn't smart enough to figure out that it should compile a C++ file
> > as
> > C++, so you need to set $CXX=clang++.
> 
> Bingo. If I define CXX=clang++ it passes qof. I removed the CXXFLAGS
> at the same time. They don't seem to be necessary.
> 
> I'm hitting the non-literal-null-conversion warning turned error in
> gnc-slots-sql.c:
> 
> /kobaltnet/janssege/Development/EclipseGnuCash/GnuCash-git/src/backend
> /sql/gnc-slots- sql.c:712:90: error: expression which evaluates to
> zero treated as a null pointer constant of type 'const gchar *' (aka
> 'const char *')
>       [-Werror,-Wnon-literal-null-conversion]
>     slot_info_t slot_info = { NULL, NULL, TRUE, NULL, 0, NULL, FRAME,
> NULL, g_string_new('\0') }; ^~~~
> /kobaltnet/janssege/Development/EclipseGnuCash/GnuCash-git/src/backen
> d/sql/gnc-slots- sql.c:739:90: error: expression which evaluates to
> zero treated as a null pointer constant of type 'const gchar *' (aka
> 'const char *')
>       [-Werror,-Wnon-literal-null-conversion]
>     slot_info_t slot_info = { NULL, NULL, TRUE, NULL, 0, NULL, FRAME,
> NULL, g_string_new('\0') }; ^~~~
> /kobaltnet/janssege/Development/EclipseGnuCash/GnuCash-git/src/backen
> d/sql/gnc-slots- sql.c:821:85: error: expression which evaluates to
> zero treated as a null pointer constant of type 'const gchar *' (aka
> 'const char *')
>       [-Werror,-Wnon-literal-null-conversion]
>     slot_info_t info = { NULL, NULL, TRUE, NULL, 0, NULL, FRAME, NULL,
> g_string_new('\0') };
> 
> I assume the cure is the same as before.
> 
> But I do wonder why you are not getting those ? Does OS X not define
> that warning be default where Fedora does ?
> 
> Geert
> _______________________________________________
> gnucash-devel mailing list
> gnucash-devel at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-devel

I have fixed these as they were fairly trivial. clang next chokes in gnc-tree-view-split-reg.c:

/kobaltnet/janssege/Development/EclipseGnuCash/GnuCash-git/src/gnome-utils/gnc-tree-view-
split-reg.c:5309:33: error: expression which evaluates to zero treated as a null pointer constant 
of type 'const gchar *' (aka 'const char *')
      [-Werror,-Wnon-literal-null-conversion]
            result  = g_strdup (TXN_TYPE_NONE);
                                ^~~~~~~~~~~~~
/kobaltnet/janssege/Development/EclipseGnuCash/GnuCash-git/src/engine/Transaction.h:119:24: 
note: expanded from macro 'TXN_TYPE_NONE'
#define TXN_TYPE_NONE    '\0' /**< No transaction type       */


More information about the gnucash-devel mailing list