⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 preprocessor-output.html

📁 gcc手册
💻 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 &copy; 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="Preprocessor%20Output">Preprocessor Output</a>,

Next:<a rel="next" accesskey="n" href="Traditional-Mode.html#Traditional%20Mode">Traditional Mode</a>,

Previous:<a rel="previous" accesskey="p" href="Other-Directives.html#Other%20Directives">Other Directives</a>,

Up:<a rel="up" accesskey="u" href="index.html#Top">Top</a>

<hr><br>

</div>



<h2 class="chapter">Preprocessor Output</h2>



   <p>When the C preprocessor is used with the C, C++, or Objective-C

compilers, it is integrated into the compiler and communicates a stream

of binary tokens directly to the compiler's parser.  However, it can

also be used in the more conventional standalone mode, where it produces

textual output.



   <p>The output from the C preprocessor looks much like the input, except

that all preprocessing directive lines have been replaced with blank

lines and all comments with spaces.  Long runs of blank lines are

discarded.



   <p>The ISO standard specifies that it is implementation defined whether a

preprocessor preserves whitespace between tokens, or replaces it with

e.g. a single space.  In GNU CPP, whitespace between tokens is collapsed

to become a single space, with the exception that the first token on a

non-directive line is preceded with sufficient spaces that it appears in

the same column in the preprocessed output that it appeared in the

original source file.  This is so the output is easy to read. 

See <a href="Differences-from-previous-versions.html#Differences%20from%20previous%20versions">Differences from previous versions</a>.  CPP does not insert any

whitespace where there was none in the original source, except where

necessary to prevent an accidental token paste.



   <p>Source file name and line number information is conveyed by lines

of the form



<pre class="example">     # <var>linenum</var> <var>filename</var> <var>flags</var>

     </pre>



<p>These are called <dfn>linemarkers</dfn>.  They are inserted as needed into

the output (but never within a string or character constant).  They mean

that the following line originated in file <var>filename</var> at line

<var>linenum</var>.  <var>filename</var> will never contain any non-printing

characters; they are replaced with octal escape sequences.



   <p>After the file name comes zero or more flags, which are <code>1</code>,

<code>2</code>, <code>3</code>, or <code>4</code>.  If there are multiple flags, spaces

separate them.  Here is what the flags mean:



     <dl>

<dt><code>1</code>

     <dd>This indicates the start of a new file. 

<br><dt><code>2</code>

     <dd>This indicates returning to a file (after having included another file). 

<br><dt><code>3</code>

     <dd>This indicates that the following text comes from a system header file,

so certain warnings should be suppressed. 

<br><dt><code>4</code>

     <dd>This indicates that the following text should be treated as being

wrapped in an implicit <code>extern "C"</code> block. 

</dl>



   <p>As an extension, the preprocessor accepts linemarkers in non-assembler

input files.  They are treated like the corresponding <code>#line</code>

directive, (see <a href="Line-Control.html#Line%20Control">Line Control</a>), except that trailing flags are

permitted, and are interpreted with the meanings described above.  If

multiple flags are given, they must be in ascending order.



   <p>Some directives may be duplicated in the output of the preprocessor. 

These are <code>#ident</code> (always), <code>#pragma</code> (only if the

preprocessor does not handle the pragma itself), and <code>#define</code> and

<code>#undef</code> (with certain debugging options).  If this happens, the

<code>#</code> of the directive will always be in the first column, and there

will be no space between the <code>#</code> and the directive name.  If macro

expansion happens to generate tokens which might be mistaken for a

duplicated directive, a space will be inserted between the <code>#</code> and

the directive name.



   </body></html>



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -