Add warnings for #directives with indented #

Zack Weinberg zack@wolery.cumb.org
Mon Apr 3 15:04:00 GMT 2000


On Mon, Apr 03, 2000 at 04:51:15PM -0400, Kaveh R. Ghazi wrote:
>
> Well, the docs contradict you. :-)   From invoke.texi:
> 
>  > @samp{-B} prefixes that effectively specify directory names also apply
>  > to libraries in the linker, because the compiler translates these
>  > options into @samp{-L} options for the linker.  They also apply to
>  > includes files in the preprocessor, because the compiler translates
>  > these options into @samp{-isystem} options for the preprocessor.  In this
>  > case, the compiler appends @samp{include} to the prefix.
> 
> Surely you agree that -B./ must at least translate into -I./include ?
> 
> If so, it makes perfect sense to mark ./include as a system header dir
> because these files are either gcc supplied system headers or platform
> "fixed" system headers.  So -isystem is entirely appropriate.

I take it back - the docs are accurate.  But something funny is going
on here:

$ stage1/xgcc -Bstage1/ -B/work/inst/i686-pc-linux-gnu/bin/ -c -DIN_GCC \
    -W -Wall -Wtraditional -O2 -g -O2  -DHAVE_CONFIG_H \
    -I. -I/work/src/gcc/gcc -I/work/src/gcc/gcc/config \
    -I/work/src/gcc/gcc/../include obstack.c -v
Reading specs from stage1/specs
gcc version 2.96 20000402 (experimental)
 stage1/cpp -lang-c -v -I. -I/work/src/gcc/gcc -I/work/src/gcc/gcc/config \
     -I/work/src/gcc/gcc/../include 
     -iprefix stage1/../lib/gcc-lib/i686-pc-linux-gnu/2.96/
     -isystem /work/inst/i686-pc-linux-gnu/bin/include -isystem include
     -isystem stage1/include -D__GNUC__=2 -D__GNUC_MINOR__=96 
     -D__GNUC_PATCHLEVEL__=0 -D__ELF__ -Dunix -Dlinux -D__ELF__
     -D__unix__ -D__linux__ -D__unix -D__linux -Asystem(posix) 
     -D__OPTIMIZE__ -g -W -Wall -Wtraditional -Acpu(i386) 
     -Amachine(i386) -Di386 -D__i386 -D__i386__ -D__tune_pentiumpro__
     -DIN_GCC -DHAVE_CONFIG_H obstack.c /tmp/cc9LNbMu.i
GNU CPP version 2.96 20000402 (experimental) (cpplib)
 (i386 Linux/ELF)
ignoring nonexistent directory `/work/inst/i686-pc-linux-gnu/bin/include'
ignoring nonexistent directory `stage1/include'
ignoring nonexistent directory `lib/gcc-lib/i686-pc-linux-gnu/2.96/include'
ignoring nonexistent directory `i686-pc-linux-gnu/include'
#include "..." search starts here:
#include <...> search starts here:
 .
 /work/src/gcc/gcc
 /work/src/gcc/gcc/config
 /work/src/gcc/include
 include
 /usr/local/include
 /work/inst/lib/gcc-lib/i686-pc-linux-gnu/2.96/include
 /work/inst/i686-pc-linux-gnu/include
 /usr/include
End of search list.

First off, with that xgcc invocation I'd expect -isystem stage1/include,
going by the docs you quoted, but I don't know where the -isystem include
came from.  Second, it is a system include directory, so why did the
warnings trigger?

zw


More information about the Gcc-patches mailing list