System Headers - Red Hat ENTERPRISE LINUX 3 - USING CPP Using Instructions

Using cpp, the c preprocessor
Hide thumbs Also See for ENTERPRISE LINUX 3 - USING CPP:
Table of Contents

Advertisement

12
Chapter 2. Header Files

2.7. System Headers

The header files declaring interfaces to the operating system and runtime libraries often cannot be
written in strictly conforming C. Therefore, GCC gives code found in system headers special treat-
ment. All warnings, other than those generated by
(Refer to Chapter 5 Diagnostics), are
#warning
suppressed while GCC is processing a system header. Macros defined in a system header are immune
to a few warnings wherever they are expanded. This immunity is granted on an ad-hoc basis, when
we find that a warning generates lots of false positives because of code in macros defined in system
headers.
Normally, only the headers found in specific directories are considered system headers. These direc-
tories are determined when GCC is compiled. There are, however, two ways to make normal headers
into system headers.
The
command line option adds its argument to the list of directories to search for headers,
-isystem
just like
. Any headers found in that directory will be considered system headers.
-I
All directories named by
are searched after all directories named by
, no matter what
-isystem
-I
their order was on the command line. If the same directory is named by both
and
, the
-I
-isystem
option is ignored. GCC provides an informative message when this occurs if
is used.
-I
-v
There is also a directive,
, which tells GCC to consider the rest of
#pragma GCC system_header
the current include file a system header, no matter where it was found. Code that comes before the
in the file will not be affected.
has no effect in the primary
#pragma
#pragma GCC system_header
source file.
On very old systems, some of the pre-defined system header directories get even more special treat-
ment. GNU C++ considers code in headers found in those directories to be surrounded by an
extern
block. There is no way to request this behavior with a
, or from the command line.
"C"
#pragma

Advertisement

Table of Contents
loading

This manual is also suitable for:

Enterprise linux 3

Table of Contents