[ccan] rbtree.c build failure with gcc 4.5.1

Rusty Russell rusty at rustcorp.com.au
Wed Dec 15 18:04:36 EST 2010


On Sun, 14 Nov 2010 09:20:19 am Scott Olson wrote:
> Hi,
> 
> I am getting the following warning/error build failure on fedora 14
> with gcc-4.5.1

Sorry for the delayed response; this mail to the list was stuck in
moderation with all the spam...

> cc1: warnings being treated as errors
> ccan/rbtree/rbtree.c: In function ‘tree_destructor_traverse_node’:
> ccan/rbtree/rbtree.c:24:2: error: taking address of expression of type ‘void’

Hmm, interesting.  Joey is right, it's gcc complaining about &*(NULL).

Your workaround (or removing -Werror) works.  Note that the typesafe_cb
testcases catch this too:

$ tools/ccanlint/ccanlint -d ccan/typesafe_cb -v
Module tests compile: PASS (+1/2)
Test compiled with warnings:
/home/rusty/devel/cvs/ccan/ccan/typesafe_cb/test/compile_ok-typesafe_cb-NULL.c:/home/rusty/devel/cvs/ccan/ccan/typesafe_cb/test/compile_ok-typesafe_cb-NULL.c: In function ‘main’:
/home/rusty/devel/cvs/ccan/ccan/typesafe_cb/test/compile_ok-typesafe_cb-NULL.c:18:2: warning: taking address of expression of type ‘void’
/home/rusty/devel/cvs/ccan/ccan/typesafe_cb/test/compile_ok-typesafe_cb-NULL.c:18:2: warning: taking address of expression of type ‘void’
/home/rusty/devel/cvs/ccan/ccan/typesafe_cb/test/compile_ok-typesafe_cb-NULL.c:18:2: warning: taking address of expression of type ‘void’
/home/rusty/devel/cvs/ccan/ccan/typesafe_cb/test/compile_ok-typesafe_cb-NULL.c:18:2: warning: taking address of expression of type ‘void’
/home/rusty/devel/cvs/ccan/ccan/typesafe_cb/test/compile_ok-typesafe_cb-NULL.c:18:2: warning: taking address of expression of type ‘void’
/home/rusty/devel/cvs/ccan/ccan/typesafe_cb/test/compile_ok-typesafe_cb-NULL.c:18:2: warning: taking address of expression of type ‘void’
/home/rusty/devel/cvs/ccan/ccan/typesafe_cb/test/compile_ok-typesafe_cb-NULL.c:18:2: warning: taking address of expression of type ‘void’
/home/rusty/devel/cvs/ccan/ccan/typesafe_cb/test/compile_ok-typesafe_cb-NULL.c:19:2: warning: taking address of expression of type ‘void’

typesafe_cb: Total score: 30/31

I'll figure something out...

Thanks for the report!
Rust.


More information about the ccan mailing list