1<html lang="en"> 2<head> 3<title>System Headers - The C Preprocessor</title> 4<meta http-equiv="Content-Type" content="text/html"> 5<meta name="description" content="The C Preprocessor"> 6<meta name="generator" content="makeinfo 4.13"> 7<link title="Top" rel="start" href="index.html#Top"> 8<link rel="up" href="Header-Files.html#Header-Files" title="Header Files"> 9<link rel="prev" href="Wrapper-Headers.html#Wrapper-Headers" title="Wrapper Headers"> 10<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> 11<!-- 12Copyright (C) 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 131997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 142008, 2009, 2010, 2011 15Free Software Foundation, Inc. 16 17Permission is granted to copy, distribute and/or modify this document 18under the terms of the GNU Free Documentation License, Version 1.3 or 19any later version published by the Free Software Foundation. A copy of 20the license is included in the 21section entitled ``GNU Free Documentation License''. 22 23This manual contains no Invariant Sections. The Front-Cover Texts are 24(a) (see below), and the Back-Cover Texts are (b) (see below). 25 26(a) The FSF's Front-Cover Text is: 27 28 A GNU Manual 29 30(b) The FSF's Back-Cover Text is: 31 32 You have freedom to copy and modify this GNU Manual, like GNU 33 software. Copies published by the Free Software Foundation raise 34 funds for GNU development. 35--> 36<meta http-equiv="Content-Style-Type" content="text/css"> 37<style type="text/css"><!-- 38 pre.display { font-family:inherit } 39 pre.format { font-family:inherit } 40 pre.smalldisplay { font-family:inherit; font-size:smaller } 41 pre.smallformat { font-family:inherit; font-size:smaller } 42 pre.smallexample { font-size:smaller } 43 pre.smalllisp { font-size:smaller } 44 span.sc { font-variant:small-caps } 45 span.roman { font-family:serif; font-weight:normal; } 46 span.sansserif { font-family:sans-serif; font-weight:normal; } 47--></style> 48<link rel="stylesheet" type="text/css" href="../cs.css"> 49</head> 50<body> 51<div class="node"> 52<a name="System-Headers"></a> 53<p> 54Previous: <a rel="previous" accesskey="p" href="Wrapper-Headers.html#Wrapper-Headers">Wrapper Headers</a>, 55Up: <a rel="up" accesskey="u" href="Header-Files.html#Header-Files">Header Files</a> 56<hr> 57</div> 58 59<h3 class="section">2.8 System Headers</h3> 60 61<p><a name="index-system-header-files-39"></a> 62The header files declaring interfaces to the operating system and 63runtime libraries often cannot be written in strictly conforming C. 64Therefore, GCC gives code found in <dfn>system headers</dfn> special 65treatment. All warnings, other than those generated by ‘<samp><span class="samp">#warning</span></samp>’ 66(see <a href="Diagnostics.html#Diagnostics">Diagnostics</a>), are suppressed while GCC is processing a system 67header. Macros defined in a system header are immune to a few warnings 68wherever they are expanded. This immunity is granted on an ad-hoc 69basis, when we find that a warning generates lots of false positives 70because of code in macros defined in system headers. 71 72 <p>Normally, only the headers found in specific directories are considered 73system headers. These directories are determined when GCC is compiled. 74There are, however, two ways to make normal headers into system headers. 75 76 <p>The <samp><span class="option">-isystem</span></samp> command line option adds its argument to the list of 77directories to search for headers, just like <samp><span class="option">-I</span></samp>. Any headers 78found in that directory will be considered system headers. 79 80 <p>All directories named by <samp><span class="option">-isystem</span></samp> are searched <em>after</em> all 81directories named by <samp><span class="option">-I</span></samp>, no matter what their order was on the 82command line. If the same directory is named by both <samp><span class="option">-I</span></samp> and 83<samp><span class="option">-isystem</span></samp>, the <samp><span class="option">-I</span></samp> option is ignored. GCC provides an 84informative message when this occurs if <samp><span class="option">-v</span></samp> is used. 85 86 <p><a name="index-g_t_0023pragma-GCC-system_005fheader-40"></a>There is also a directive, <code>#pragma GCC system_header<!-- /@w --></code>, which 87tells GCC to consider the rest of the current include file a system 88header, no matter where it was found. Code that comes before the 89‘<samp><span class="samp">#pragma</span></samp>’ in the file will not be affected. <code>#pragma GCC system_header<!-- /@w --></code> has no effect in the primary source file. 90 91 <p>On very old systems, some of the pre-defined system header directories 92get even more special treatment. GNU C++ considers code in headers 93found in those directories to be surrounded by an <code>extern "C"<!-- /@w --></code> 94block. There is no way to request this behavior with a ‘<samp><span class="samp">#pragma</span></samp>’, 95or from the command line. 96 97 </body></html> 98 99