📄 system-headers.html
字号:
<html lang="en">
<head>
<title>The C Preprocessor</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="The C Preprocessor">
<meta name="generator" content="makeinfo 4.3">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home">
<!--
Copyright © 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996,
1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
<p>Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1 or
any later version published by the Free Software Foundation. A copy of
the license is included in the
section entitled "GNU Free Documentation License".
<p>This manual contains no Invariant Sections. The Front-Cover Texts are
(a) (see below), and the Back-Cover Texts are (b) (see below).
<p>(a) The FSF's Front-Cover Text is:
<p>A GNU Manual
<p>(b) The FSF's Back-Cover Text is:
<p>You have freedom to copy and modify this GNU Manual, like GNU
software. Copies published by the Free Software Foundation raise
funds for GNU development.
-->
</head>
<body>
<div class="node">
<p>
Node:<a name="System%20Headers">System Headers</a>,
Previous:<a rel="previous" accesskey="p" href="Wrapper-Headers.html#Wrapper%20Headers">Wrapper Headers</a>,
Up:<a rel="up" accesskey="u" href="Header-Files.html#Header%20Files">Header Files</a>
<hr><br>
</div>
<h3 class="section">System Headers</h3>
<p>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 <dfn>system headers</dfn> special
treatment. All warnings, other than those generated by <code>#warning</code>
(see <a href="Diagnostics.html#Diagnostics">Diagnostics</a>), are 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.
<p>Normally, only the headers found in specific directories are considered
system headers. These directories are determined when GCC is compiled.
There are, however, two ways to make normal headers into system headers.
<p>The <code>-isystem</code> command line option adds its argument to the list of
directories to search for headers, just like <code>-I</code>. Any headers
found in that directory will be considered system headers.
<p>All directories named by <code>-isystem</code> are searched <em>after</em> all
directories named by <code>-I</code>, no matter what their order was on the
command line. If the same directory is named by both <code>-I</code> and
<code>-isystem</code>, the <code>-I</code> option is ignored. GCC provides an
informative message when this occurs if <code>-v</code> is used.
<p>There is also a directive, <code>#pragma GCC system_header</code>, which
tells GCC to consider the rest of the current include file a system
header, no matter where it was found. Code that comes before the
<code>#pragma</code> in the file will not be affected. <code>#pragma GCC system_header</code> has no effect in the primary source file.
<p>On very old systems, some of the pre-defined system header directories
get even more special treatment. GNU C++ considers code in headers
found in those directories to be surrounded by an <code>extern "C"</code>
block. There is no way to request this behavior with a <code>#pragma</code>,
or from the command line.
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -