This is the mail archive of the gcc-help@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]
Other format: [Raw text]

Re: error: template with C linkage


Miles Bader <miles@gnu.org> writes:

> Marc Glisse <marc.glisse@inria.fr> writes:
>> And being a system header is a property that depends on the directory
>> the file is in.
>
> Do you know how gcc define's "system header" ?
>
> I've noticed that I sometimes get compiler warnings for library header
> files, even though they're located in subdirectories of /usr/include and
> -Wno-system-headers is turned on...
>
> So I guess the test isn't just a simple prefix comparison with
> "/usr/include/" ...

You can see the set of system directories for your system by compiling a
file with the -v option.  They are the ones that come after

#include <...> search starts here:

Normally it's /usr/include, /usr/local/include, and a couple of target-
and version- specific directories.

If a file in /usr/include/X is #included as <X/a.h> then it will be a
system directory.  But if you are using an explicit -I then it will not.
You can make it a system directory by using -isystem rather than -I.

Ian


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