Compile warning OpenBSD 3.7

Started by pjot, May 30, 2005, 02:10:49 PM

Previous topic - Next topic

pjot

Installed OpenBSD 3.7 and compiled the latest newLisp package (8.5.10). They have moved to GCC 3.3.5:


Quote
peter@starcrater:~/programming/newlisp-8.5.10$ gcc --version

gcc (GCC) 3.3.5 (propolice)

Copyright (C) 2003 Free Software Foundation, Inc.

This is free software; see the source for copying conditions.  There is NO

warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

peter@starcrater:~/programming/newlisp-8.5.10$ make bsd

make -f makefile_bsd

gcc -Wall -Wno-uninitialized -O2 -c -g -DNANOSLEEP -DREADLINE -D_BSD newlisp.c

gcc -Wall -Wno-uninitialized -O2 -c -g -DNANOSLEEP -DREADLINE -D_BSD nl-symbol.c

gcc -Wall -Wno-uninitialized -O2 -c -g -DNANOSLEEP -DREADLINE -D_BSD nl-math.c

gcc -Wall -Wno-uninitialized -O2 -c -g -DNANOSLEEP -DREADLINE -D_BSD nl-list.c

gcc -Wall -Wno-uninitialized -O2 -c -g -DNANOSLEEP -DREADLINE -D_BSD nl-liststr.c

gcc -Wall -Wno-uninitialized -O2 -c -g -DNANOSLEEP -DREADLINE -D_BSD nl-string.c

gcc -Wall -Wno-uninitialized -O2 -c -g -DNANOSLEEP -DREADLINE -D_BSD nl-filesys.c

gcc -Wall -Wno-uninitialized -O2 -c -g -DNANOSLEEP -DREADLINE -D_BSD nl-sock.c

gcc -Wall -Wno-uninitialized -O2 -c -g -DNANOSLEEP -DREADLINE -D_BSD nl-import.c

gcc -Wall -Wno-uninitialized -O2 -c -g -DNANOSLEEP -DREADLINE -D_BSD nl-xml.c

gcc -Wall -Wno-uninitialized -O2 -c -g -DNANOSLEEP -DREADLINE -D_BSD nl-web.c

gcc -Wall -Wno-uninitialized -O2 -c -g -DNANOSLEEP -DREADLINE -D_BSD nl-matrix.c

gcc -Wall -Wno-uninitialized -O2 -c -g -DNANOSLEEP -DREADLINE -D_BSD nl-debug.c

gcc -Wall -Wno-uninitialized -O2 -c -g -DNANOSLEEP -DREADLINE -D_BSD 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.o nl-web.o nl-matrix.o nl-debug.o pcre.o -g -lm -lreadline -lncurses -o newlisp

newlisp.o(.text+0xf05): In function `initialize':

/home/peter/programming/newlisp-8.5.10/newlisp.c:910: warning: sprintf() is often misused, please use snprintf()

strip newlisp


NewLisp compiles and runs all right, the tests pass, but GCC produces a new warning: the C-function 'sprintf' appears to be unsafe. I also suffer from this problem with my GTK-server.



I thought I'ld let you know.



Peter

Lutz

#1
I am aware of these warninngs in OpenBSD and have verified, that all usages of sprintf(), strcat() and strcpy() are safe against buffer overflow the way they are used in few places newLISP, in each case the number of bytes copied is under control.



Lutz