-Wno-deprecated-register with Clang

John Ralls jralls at ceridwen.us
Wed Jul 2 05:55:32 EDT 2014


On Jul 2, 2014, at 10:50 AM, Geert Janssens <janssens-geert at telenet.be> wrote:

> On Wednesday 02 July 2014 09:58:28 John Ralls wrote:
>  
> It has been a while since I ran clang so I decided to retry this morning. It doesn't build for me.
>  
> With current master (including Mike's fix) the build errors out on gnc-date.cpp:
>  
> make[5]: Entering directory `/kobaltnet/janssege/Development/Builds/gnucash-f20-master/src/libqof/qof'
> /bin/sh ../../../libtool  --tag=CXX   --mode=compile clang -DHAVE_CONFIG_H -I. -I/kobaltnet/janssege/Development/EclipseGnuCash/GnuCash-git/src/libqof/qof -I../../..  -I/kobaltnet/janssege/Development/EclipseGnuCash/GnuCash-git/lib/libc -I/kobaltnet/janssege/Development/EclipseGnuCash/GnuCash-git/src -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -I/usr/include -DG_LOG_DOMAIN=\"qof\"  -Werror  -Wall -Wno-unused -g  -std=gnu++11 -g  -MT gnc-date.lo -MD -MP -MF .deps/gnc-date.Tpo -c -o gnc-date.lo /kobaltnet/janssege/Development/EclipseGnuCash/GnuCash-git/src/libqof/qof/gnc-date.cpp
> libtool: compile:  clang -DHAVE_CONFIG_H -I. -I/kobaltnet/janssege/Development/EclipseGnuCash/GnuCash-git/src/libqof/qof -I../../.. -I/kobaltnet/janssege/Development/EclipseGnuCash/GnuCash-git/lib/libc -I/kobaltnet/janssege/Development/EclipseGnuCash/GnuCash-git/src -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include -DG_LOG_DOMAIN=\"qof\" -Werror -Wall -Wno-unused -g -std=gnu++11 -g -MT gnc-date.lo -MD -MP -MF .deps/gnc-date.Tpo -c /kobaltnet/janssege/Development/EclipseGnuCash/GnuCash-git/src/libqof/qof/gnc-date.cpp  -fPIC -DPIC -o .libs/gnc-date.o
> In file included from /kobaltnet/janssege/Development/EclipseGnuCash/GnuCash-git/src/libqof/qof/gnc-date.cpp:34:
> In file included from /usr/include/glib-2.0/glib.h:56:
> In file included from /usr/include/glib-2.0/glib/giochannel.h:36:
> In file included from /usr/include/glib-2.0/glib/gstring.h:37:
> /usr/include/glib-2.0/glib/gutils.h:321:3: error: 'register' storage class specifier is deprecated [-Werror,-Wdeprecated-register]
>   register guint n_bits = 0;
>   ^~~~~~~~~
> 1 error generated.
> make[5]: *** [gnc-date.lo] Error 1
> make[5]: Leaving directory `/kobaltnet/janssege/Development/Builds/gnucash-f20-master/src/libqof/qof'
> make[4]: *** [all-recursive] Error 1
> make[4]: Leaving directory `/kobaltnet/janssege/Development/Builds/gnucash-f20-master/src/libqof/qof'
> make[3]: *** [all-recursive] Error 1
> make[3]: Leaving directory `/kobaltnet/janssege/Development/Builds/gnucash-f20-master/src/libqof'
> 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
>  
>  
> If I revert Mike's commit I get a little further, but still it breaks in qof/test:

What commit is that? I think you mean my commit, which disables -Wno-deprecated-register on clang. I just pushed a replacement which tests for accepting no-deprecated-register, a better strategy than testing for a particular compiler anyway.

>  
> clang -DHAVE_CONFIG_H -I. -I/kobaltnet/janssege/Development/EclipseGnuCash/GnuCash-git/src/libqof/qof/test -I../../../..  -I. -I/kobaltnet/janssege/Development/EclipseGnuCash/GnuCash-git/src/libqof/qof/test -I../../../.. -I/kobaltnet/janssege/Development/EclipseGnuCash/GnuCash-git/src/libqof/qof -I/kobaltnet/janssege/Development/EclipseGnuCash/GnuCash-git/src/test-core -DTESTPROG=test_qof -I/kobaltnet/janssege/Development/EclipseGnuCash/GnuCash-git/lib/libc -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include   -Werror -Wdeclaration-after-statement -Wno-pointer-sign  -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations  -Wno-unused -g  -g  -MT test_qof-test-qofbook.o -MD -MP -MF .deps/test_qof-test-qofbook.Tpo -c -o test_qof-test-qofbook.o `test -f 'test-qofbook.c' || echo '/kobaltnet/janssege/Development/EclipseGnuCash/GnuCash-git/src/libqof/qof/test/'`test-qofbook.c
> /kobaltnet/janssege/Development/EclipseGnuCash/GnuCash-git/src/libqof/qof/test/test-qofbook.c:264:52: error: expression which evaluates to zero treated as a null pointer constant of type 'const char *'
>       [-Werror,-Wnon-literal-null-conversion]
>     counter = qof_book_get_counter( fixture->book, '\0' );
>                                                    ^~~~
> /kobaltnet/janssege/Development/EclipseGnuCash/GnuCash-git/src/libqof/qof/test/test-qofbook.c:301:53: error: expression which evaluates to zero treated as a null pointer constant of type 'const char *'
>       [-Werror,-Wnon-literal-null-conversion]
>     r = qof_book_get_counter_format( fixture->book, '\0' );
>                                                     ^~~~
> /kobaltnet/janssege/Development/EclipseGnuCash/GnuCash-git/src/libqof/qof/test/test-qofbook.c:343:63: error: expression which evaluates to zero treated as a null pointer constant of type 'const char *'
>       [-Werror,-Wnon-literal-null-conversion]
>     r = qof_book_increment_and_format_counter( fixture->book, '\0' );
>                                                               ^~~~
> 3 errors generated.
> make[5]: *** [test_qof-test-qofbook.o] Error 1
> make[5]: Leaving directory `/kobaltnet/janssege/Development/Builds/gnucash-f20-master/src/libqof/qof/test'
> make[4]: *** [all-recursive] Error 1
> make[4]: Leaving directory `/kobaltnet/janssege/Development/Builds/gnucash-f20-master/src/libqof/qof'
> make[3]: *** [all-recursive] Error 1
> make[3]: Leaving directory `/kobaltnet/janssege/Development/Builds/gnucash-f20-master/src/libqof'
> 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

We can replace those three instances with NULL; I just checked and they're the only ones. I'll push that change later.

Regards,
John Ralls




More information about the gnucash-devel mailing list