Building tor on Solaris10-Sparc and SunStudio CC

Nick Mathewson nickm at torproject.org
Mon Aug 31 18:54:58 UTC 2009


On Wed, Aug 26, 2009 at 09:05:55PM +0200, Thomas.Hluchnik at netcologne.de wrote:

 [...]
> 
> source='compat.c' object='compat.o' libtool=no \
> 	DEPDIR=.deps depmode=none /bin/bash ../../depcomp \
> 	cc -DHAVE_CONFIG_H -I. -I../.. -I../../src/common  -I/usr/local/ssl/include -g -g -O -c compat.c
> "compat.c", line 373: warning: initializer does not fit or is out of range: 128
> "compat.c", line 373: warning: initializer does not fit or is out of range: 129

Oh.  It looks like your 'char' is signed.  These should be harmless,
but somebody should write a patch for this.  Probably, making the
array into an array of 'unsigned char', and adding a cast to the
functions that use it, would suffice.

> "compat.c", line 373: warning: initializer does not fit or is out of range: 130
> ...
> ... # lots of lines here !
> ...
> "compat.c", line 398: warning: initializer does not fit or is out of range: 255
> "compat.c", line 1162: warning: statement not reached

Weird; I wonder why we don't see this one on more platforms.

> "compat.c", line 2177: warning: initializer does not fit or is out of range: -1

This could use an explicit cast.  We want an identifier that's not
going to be a thread ID.


> 
> 
> source='circuituse.c' object='circuituse.o' libtool=no \
> 	DEPDIR=.deps depmode=none /bin/bash ../../depcomp \
> 	cc -DHAVE_CONFIG_H -I. -I../.. -DSHARE_DATADIR="\"/usr/share\"" -DLOCALSTATEDIR="\"/usr/var\"" -DBINDIR="\"/usr/bin\"" -I../../src/common  -I/usr/local/ssl/include   -g -g -O -c circuituse.c
> "circuitlist.c", line 679: warning: loop not entered at top

Loop not entered at all, apparently.  This code should be in an #if
0/#endif block.

> 
> 
> 
> source='buffers.c' object='buffers.o' libtool=no \
> 	DEPDIR=.deps depmode=none /bin/bash ../../depcomp \
> 	cc -DHAVE_CONFIG_H -I. -I../.. -DSHARE_DATADIR="\"/usr/share\"" -DLOCALSTATEDIR="\"/usr/var\"" -DBINDIR="\"/usr/bin\"" -I../../src/common  -I/usr/local/ssl/include   -g -g -O -c buffers.c
> "buffers.c", line 1456: warning: statement not reached
> 

This should probably be tor_fragile_assert(); break;

> 
> 
> source='geoip.c' object='geoip.o' libtool=no \
> 	DEPDIR=.deps depmode=none /bin/bash ../../depcomp \
> 	cc -DHAVE_CONFIG_H -I. -I../..  -DSHARE_DATADIR="\"/usr/share\"" -DLOCALSTATEDIR="\"/usr/var\"" -DBINDIR="\"/usr/bin\"" -I../../src/common  -I/usr/local/ssl/include   -g -g -O -c geoip.c
> "geoip.c", line 296: warning: syntax error:  empty declaration
> "geoip.c", line 298: warning: syntax error:  empty declaration
> 

That's inside a huge macro expansion; I can't do much to debug it.


It would be neat if somebody who can program C and who uses this
version of sun CC would clean up these warnings and send in a patch.
It's nice to build warning-free on as many platforms as possible.

yrs,
-- 
Nick



More information about the tor-dev mailing list