cpp: System Headers
1
1 2.8 System Headers
1 ==================
1
1 The header files declaring interfaces to the operating system and
1 runtime libraries often cannot be written in strictly conforming C.
1 Therefore, GCC gives code found in "system headers" special treatment.
11 All warnings, other than those generated by '#warning' (⇒
Diagnostics), are suppressed while GCC is processing a system header.
1 Macros defined in a system header are immune to a few warnings wherever
1 they are expanded. This immunity is granted on an ad-hoc basis, when we
1 find that a warning generates lots of false positives because of code in
1 macros defined in system headers.
1
1 Normally, only the headers found in specific directories are
1 considered system headers. These directories are determined when GCC is
1 compiled. There are, however, two ways to make normal headers into
1 system headers:
1
1 * Header files found in directories added to the search path with the
1 '-isystem' and '-idirafter' command-line options are treated as
1 system headers for the purposes of diagnostics.
1
1 * There is also a directive, '#pragma GCC system_header', which tells
1 GCC to consider the rest of the current include file a system
1 header, no matter where it was found. Code that comes before the
1 '#pragma' in the file is not affected. '#pragma GCC system_header'
1 has no effect in the primary source file.
1