Miles Bader <miles@xxxxxxx> writes: > Marc Glisse <marc.glisse@xxxxxxxx> 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