This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: sparc-sun-solaris2.8 headers: fixinc, cpplib
- To: neil at daikokuya dot demon dot co dot uk
- Subject: Re: sparc-sun-solaris2.8 headers: fixinc, cpplib
- From: RDBrown at mira dot net
- Date: Wed, 20 Dec 2000 09:33:15 +1100 (EST)
- CC: gcc at gcc dot gnu dot org
- Reply-To: RDBrown at mira dot net,RodneyBrown at mynd dot com
I was attempting to hack together a test case for your system headers fix.
The "warning: `xxx' defined but not used" is disabled if an include file
is declared to be a system header with -isystem, but not if a
#pragma GCC system_header
is used.
$ cat junk.c
#include <junk.h>
void
utter_junk(void)
{
}
$ cat junk.h
extern void a0(void);
static void
a1(void)
{
a0();
}
$ gcc-20001218.chk/gcc/stage1/xgcc -B./gcc-20001218.chk/gcc/stage1/ \
-c -Wall -I. junk.c
junk.h:5: warning: `a1' defined but not used
$ gcc-20001218.chk/gcc/stage1/xgcc -B./gcc-20001218.chk/gcc/stage1/ \
-c -Wall -isystem . junk.c
$ cat syshdr2.h
/* This file would generate an error because of #include_next, but the
#pragma marks it a system header, so the error is suppressed. */
#pragma GCC system_header
extern void a0(void);
static void
a1(void)
{
a0();
}
#include_next <stdio.h>
$ gcc-20001218.chk/gcc/stage1/xgcc -B./gcc-20001218.chk/gcc/stage1/ \
-c -Wall -ansi -pedantic-errors syshdr.c
In file included from syshdr.c:11:
syshdr1.h:4:2: #include_next is a GCC extension
syshdr2.h:9: warning: `a1' defined but not used
$ gcc-20001218.chk/gcc/stage1/xgcc -B./gcc-20001218.chk/gcc/stage1/ \
-c -Wall -ansi -pedantic-errors -isystem ..syshdr.c
In file included from syshdr.c:11:
syshdr1.h:4:2: #include_next is a GCC extension
syshdr2.h:9: warning: `a1' defined but not used