Compiling newlisp using Oracle Studio compiler in SPARC S10

Machine-specific discussion
Unix, Linux, OS X, OS/2, Windows, ..?
Locked
jopython
Posts: 123
Joined: Tue Sep 14, 2010 3:08 pm

Compiling newlisp using Oracle Studio compiler in SPARC S10

Post by jopython »

I compiled newlisp 10.3.3 using Oracle Studio 12 in SPARC Solaris 10 platform and got these warnings.

make -f makefile_modifiedsunos

cc -m32 -c -O2 -DSUNOS newlisp.c
"newlisp.c", line 851: warning: statement not reached
"newlisp.c", line 3571: warning: statement not reached
"newlisp.c", line 3614: warning: integer overflow detected: op "<<"
"newlisp.c", line 3715: warning: integer overflow detected: op "<<"
cc -m32 -c -O2 -DSUNOS nl-symbol.c
cc -m32 -c -O2 -DSUNOS nl-math.c
cc -m32 -c -O2 -DSUNOS nl-list.c
cc -m32 -c -O2 -DSUNOS nl-liststr.c
cc -m32 -c -O2 -DSUNOS nl-string.c
cc -m32 -c -O2 -DSUNOS nl-filesys.c
cc -m32 -c -O2 -DSUNOS nl-sock.c
cc -m32 -c -O2 -DSUNOS nl-import.c
cc -m32 -c -O2 -DSUNOS nl-xml.c
cc -m32 -c -O2 -DSUNOS nl-web.c
"nl-web.c", line 570: warning: statement not reached
cc -m32 -c -O2 -DSUNOS nl-matrix.c
cc -m32 -c -O2 -DSUNOS nl-debug.c
cc -m32 -c -O2 -DSUNOS pcre.c
cc newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o nl-sock.o nl-import.o nl-xml.o nl-web.o nl-matrix.o nl-debug.o pcre.o -m32 -lm -ldl -lrt -lsocket -lnsl -o newlisp
$ ./newlisp -h

newLISP v.10.3.3 Copyright (c) 2011 Lutz Mueller. All rights reserved.

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Re: Compiling newlisp using Oracle Studio compiler in SPARC

Post by Lutz »

Sometimes compiler warnings are bogus or conflicting, e.g. a return statement at the end of a function may never be reached, but if you don't have a return(..) statement for a non-void function, the compiler complains too ;-( It's always worth to inspect each compiler warning to see what's really going on, sometimes the compiler just ins't smart enough.

This is the way I generally go about compiler warnings:

With each stable and development release, I deliver the big 3: Mac OSX, Windows XP SP2 and UBUNTU Linux without warnings, using the latest - sometimes previous to latest - gcc compiler. Additionally, I also check the latest or second latest OpenBSD version and an older version of SunOS (1). Every new version of gcc on these platforms evokes new warnings, which than will be eliminated.

When compiling on lesser known hardware, it is also worth to check the memory model of the platform. newLISP supports ILP32 and LP64 - the most popular. See the file newlisp-x.x.x/util/types.c for information how to check this.

Last not least, always do a 'make testall', running an extended test suite.

(1) SunOS carbon 5.8 Generic_117350-25 sun4u sparc SUNW,Ultra-2

Locked