in_system_header warning not suppressed

Robert Lipe robertl@sco.com
Wed Dec 6 09:11:00 GMT 2000


If I have a single line file with:
	#include <sys/stat.h>
current gcc -Wall will give me warnings of:
	/usr/include/sys/stat.h:234: warning: `stat' defined but not used
	/usr/include/sys/stat.h:238: warning: `fstat' defined but not used
	/usr/include/sys/stat.h:245: warning: `lstat' defined but not used
	/usr/include/sys/stat.h:252: warning: `statlstat' defined but not used

The system headers on both UnixWare and OpenServer have a couple of
static wrapper functions of this form.  This warning has come and gone
through the last couple of quarters.  I can't tell when it most recently
appeared becuase my ticket to bootstrapsville has been invalid for a
couple of months.

If I compile the *.i build with --save-temps, I don't get this warning.
I think this points to integrated cpp somehow failing to set things up
so that DECL_IN_SYSETEM_HEADER isn't set, but I'm not sure.

$ ./xgcc -v -Wall -B./ ../x.c
Reading specs from ./specs
Configured with: /play/egcs/configure
gcc version 2.97 20001206 (experimental)
 ./cc1 -lang-c -v -iprefix ./../lib/gcc-lib/i686-pc-sco3.2v5.0.6/2.97/ -isystem
./include -D__GNUC__=2 -D__GNUC_MINOR__=97 -D__GNUC_PATCHLEVEL__=0 -Asystem=svr3
 -D__STDC_HOSTED__=1 -Wall -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__
-D__tune_i686__ -D__tune_pentiumpro__ -D__i386 -D__unix -D_SCO_DS=1 -D_M_I386 -D
_M_XENIX -D_M_UNIX -D_STRICT_NAMES -D_SCO_XPG_VERS=4 -D_M_I86 -D_M_I86SM -D_M_IN
TERNAT -D_M_SDATA -D_M_STEXT -D_M_BITFIELDS -D_M_SYS5 -D_M_SYSV -D_M_SYSIII -D_M
_WORDSWAP -Dunix -DM_I386 -DM_UNIX -DM_XENIX -D_SCO_ELF -D_SCO_C_DIALECT=1 ../x.
c -quiet -dumpbase x.c -Wall -version -o /usr/tmp/cc9dMFCe.s
GNU CPP version 2.97 20001206 (experimental) (cpplib) (i386, SCO OpenServer 5 Sy
ntax)
ignoring nonexistent directory "include"
GNU C version 2.97 20001206 (experimental) (i686-pc-sco3.2v5.0.6) compiled by GN
U C version 2.97 20001206 (experimental).
ignoring nonexistent directory "../lib/gcc-lib/i686-pc-sco3.2v5.0.6/2.97/include
"
ignoring nonexistent directory "../i686-pc-sco3.2v5.0.6/include"
ignoring nonexistent directory "/usr/local/lib/gcc-lib/i686-pc-sco3.2v5.0.6/2.97
/include"
ignoring nonexistent directory "/usr/local/i686-pc-sco3.2v5.0.6/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/include
End of search list.
/usr/include/sys/stat.h:234: warning: `stat' defined but not used
/usr/include/sys/stat.h:238: warning: `fstat' defined but not used
/usr/include/sys/stat.h:245: warning: `lstat' defined but not used
/usr/include/sys/stat.h:252: warning: `statlstat' defined but not used
 /usr/ccs/bin/as -b elf -Ea,XPG4PLUS,ELF -Qn -o /usr/tmp/ccqTehGb.o /usr/tmp/cc9
dMFCe.s


RJL


More information about the Gcc-bugs mailing list