warning output depending on kind of include

Thomas Porschberg thomas.porschberg@osp-dd.de
Sun Jun 9 23:43:00 GMT 2002


I use gcc3.1 on hpux and have a question about warning generation
depending on includes.

I wrote a small class, say a.cc/a.hh, that includes a special headerfile in
a.hh, that causes a lot off warnings if I i include a.hh with '#include "a.hh"'
in a.cc.
If I include a.hh with '#include <a.hh>' no warning is generated.

Furthermore I do not understand why gcc find the header file. It is located
in the same directory like a.cc and I do not specify the current directory
with -I. in the include path.
If I specify the current directory in include path with -I. and
include with #include <a.hh>, the warnings appear again.
Additional a warning about system non-system directory is thrown.

cc1plus: warning: changing search order for system directory "."
cc1plus: warning:   as it has already been specified as a non-system directory

Can anyone explain this behavior ?
Especially why does warnings are generated in the first case and in the second not?

I could not comprehend this behavior on my linux box. No warning was thrown, besides
the one for 

cc1plus: warning: changing search order for system directory "."
cc1plus: warning:   as it has already been specified as a non-system directory

if I put the a.hh in a system-directory like /usr/local/include.

So on hpux the current directory is a system directoy and on linux not ?

thomas

-- 



More information about the Gcc-help mailing list