Errors compiling 10.5.8 on Solaris 10 with gcc

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

Errors compiling 10.5.8 on Solaris 10 with gcc

Post by jopython »

Are these errors normal.

Code: Select all

$ make -f makefile_sunos
gcc -m32 -Wall -pedantic -Wno-uninitialized -Wno-long-long -c -O2 -DSUNOS newlisp.c
newlisp.c: In function `evaluateExpression':
newlisp.c:1493: warning: ISO C90 forbids mixed declarations and code
newlisp.c: In function `p_apply':
newlisp.c:4686: warning: dereferencing type-punned pointer will break strict-aliasing rules
newlisp.c: In function `implicitNrestSlice':
newlisp.c:5382: warning: dereferencing type-punned pointer will break strict-aliasing rules
newlisp.c:5395: warning: dereferencing type-punned pointer will break strict-aliasing rules
newlisp.c: In function `p_mainArgs':
newlisp.c:7109: warning: dereferencing type-punned pointer will break strict-aliasing rules
gcc -m32 -Wall -pedantic -Wno-uninitialized -Wno-long-long -c -O2 -DSUNOS nl-symbol.c
gcc -m32 -Wall -pedantic -Wno-uninitialized -Wno-long-long -c -O2 -DSUNOS nl-math.c
nl-math.c: In function `randomDist':
nl-math.c:1335: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-math.c: In function `p_series':
nl-math.c:1915: warning: dereferencing type-punned pointer will break strict-aliasing rules
gcc -m32 -Wall -pedantic -Wno-uninitialized -Wno-long-long -c -O2 -DSUNOS nl-list.c
nl-list.c: In function `explodeList':
nl-list.c:142: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-list.c: In function `p_lookup':
nl-list.c:589: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-list.c: In function `implicitIndexList':
nl-list.c:1022: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-list.c:1030: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-list.c:1060: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-list.c: In function `implicitIndexArray':
nl-list.c:2001: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-list.c:2009: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-list.c:2023: warning: dereferencing type-punned pointer will break strict-aliasing rules
gcc -m32 -Wall -pedantic -Wno-uninitialized -Wno-long-long -c -O2 -DSUNOS nl-liststr.c
nl-liststr.c: In function `p_chop':
nl-liststr.c:359: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-liststr.c: In function `p_push':
nl-liststr.c:475: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-liststr.c:480: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-liststr.c:540: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-liststr.c: In function `p_pop':
nl-liststr.c:608: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-liststr.c:613: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-liststr.c:635: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-liststr.c: In function `popString':
nl-liststr.c:670: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-liststr.c:673: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-liststr.c: In function `pushOnString':
nl-liststr.c:716: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-liststr.c: In function `p_select':
nl-liststr.c:795: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-liststr.c:799: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-liststr.c:842: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-liststr.c:846: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-liststr.c: In function `p_slice':
nl-liststr.c:876: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-liststr.c:878: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-liststr.c: In function `p_find':
nl-liststr.c:1054: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-liststr.c: In function `p_dup':
nl-liststr.c:1357: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-liststr.c: In function `p_rotate':
nl-liststr.c:1634: warning: dereferencing type-punned pointer will break strict-aliasing rules
gcc -m32 -Wall -pedantic -Wno-uninitialized -Wno-long-long -c -O2 -DSUNOS nl-string.c
nl-string.c: In function `implicitIndexString':
nl-string.c:178: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-string.c: In function `p_char':
nl-string.c:281: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-string.c: In function `p_explode':
nl-string.c:381: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-string.c: In function `p_pack':
nl-string.c:1703: warning: dereferencing type-punned pointer will break strict-aliasing rules
gcc -m32 -Wall -pedantic -Wno-uninitialized -Wno-long-long -c -O2 -DSUNOS nl-filesys.c
nl-filesys.c: In function `p_readBuffer':
nl-filesys.c:287: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-filesys.c: In function `writeBuffer':
nl-filesys.c:529: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-filesys.c: In function `p_share':
nl-filesys.c:2119: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-filesys.c:2127: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-filesys.c: In function `p_date':
nl-filesys.c:2472: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-filesys.c: In function `p_now':
nl-filesys.c:2649: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-filesys.c: In function `p_dateList':
nl-filesys.c:2726: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-filesys.c:2727: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-filesys.c: In function `p_dateValue':
nl-filesys.c:2763: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-filesys.c:2764: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-filesys.c:2765: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-filesys.c:2772: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-filesys.c:2773: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-filesys.c:2774: warning: dereferencing type-punned pointer will break strict-aliasing rules
gcc -m32 -Wall -pedantic -Wno-uninitialized -Wno-long-long -c -O2 -DSUNOS nl-sock.c
nl-sock.c: In function `p_netReceive':
nl-sock.c:913: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-sock.c: In function `p_netReceiveUDP':
nl-sock.c:1052: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-sock.c: In function `p_netReceiveFrom':
nl-sock.c:1084: warning: dereferencing type-punned pointer will break strict-aliasing rules
nl-sock.c: In function `p_netSend':
nl-sock.c:1104: warning: dereferencing type-punned pointer will break strict-aliasing rules
gcc -m32 -Wall -pedantic -Wno-uninitialized -Wno-long-long -c -O2 -DSUNOS nl-import.c
gcc -m32 -Wall -pedantic -Wno-uninitialized -Wno-long-long -c -O2 -DSUNOS nl-xml-json.c
gcc -m32 -Wall -pedantic -Wno-uninitialized -Wno-long-long -c -O2 -DSUNOS nl-web.c
gcc -m32 -Wall -pedantic -Wno-uninitialized -Wno-long-long -c -O2 -DSUNOS nl-matrix.c
gcc -m32 -Wall -pedantic -Wno-uninitialized -Wno-long-long -c -O2 -DSUNOS nl-debug.c
gcc -m32 -Wall -pedantic -Wno-uninitialized -Wno-long-long -c -O2 -DSUNOS pcre.c
gcc 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-json.o nl-web.o nl-matrix.o nl-debug.o pcre.o -m32 -lm -ldl -lrt -lsocket -lnsl -o newlisp
Tests pass fine however.

Code: Select all

$ make test
make check | grep '>>>'
>>>>> ALL FUNCTIONS FINISHED SUCCESSFUL: ./newlisp
>>>>> Dictionary API tested SUCCESSFUL
>>>>> XML API tested SUCCESSFUL
>>>>> XML callback tested SUCCESSFUL
>>>>> JSON translation tested SUCESSFUL
>>>>> Signal testing SUCCESSFUL
>>>>> Network eval and network file functions IPv4 SUCCESSFUL
>>>>> The Cilk API tested SUCCESSFUL
>>>>> Reference testing SUCCESSFUL
>>>>> Time per simple message: 31 micro seconds
>>>>> Time per round trip : 280 micros seconds
>>>>> Time per proxy trip: 110 micro seconds
>>>>> Message API tested SUCCESSFUL
>>>>> abs bigint float gcd length zero? + - * / % ++ -- big ints tested SUCCESSFUL
>>>>> Benchmarking all non I/O primitives ... (may take a while)
>>>>> total time: 16811.294
>>>>> Performance ratio: 6.56 (1.0 on MacOSX 10.9, 2.3GHz Intel Core i5, newLISP v10.5.7-64-bit)

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

Re: Errors compiling 10.5.8 on Solaris 10 with gcc

Post by Lutz »

The aliasing warnings are ok and also have to be suppressed on AIX, BSD, Linux and on some more. Put -fno-strict-aliasing into the gcc line.

For the ISO_C90 warning add SUNOS in line 41 of newlisp.h:

Code: Select all

#if defined(CYGWN) || defined(OS2) || defined(SOLARIS) || defined(AIX) || defined(SUNOS)
… or perhaps you should try makefile_opensolaris instead of makefile_sunos

jopython
Posts: 123
Joined: Tue Sep 14, 2010 3:08 pm

Re: Errors compiling 10.5.8 on Solaris 10 with gcc

Post by jopython »

I added -fno-strict-aliasing to CFLAGS and updated line 41 in newlisp.h.
I was able to compile successfully and test without any of those warnings.
Thank you

Locked