This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: sparc-sun-solaris2.8 headers: fixinc, cpplib


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]