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

📄 implementation-defined-behavior.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="Implementation-defined%20behavior">Implementation-defined behavior</a>,

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

Up:<a rel="up" accesskey="u" href="Implementation-Details.html#Implementation%20Details">Implementation Details</a>

<hr><br>

</div>



<h3 class="section">Implementation-defined behavior</h3>



   <p>This is how CPP behaves in all the cases which the C standard

describes as <dfn>implementation-defined</dfn>.  This term means that the

implementation is free to do what it likes, but must document its choice

and stick to it.



     <ul>

<li>The mapping of physical source file multi-byte characters to the

execution character set.



     <p>Currently, GNU cpp only supports character sets that are strict supersets

of ASCII, and performs no translation of characters.



     </p><li>Non-empty sequences of whitespace characters.



     <p>In textual output, each whitespace sequence is collapsed to a single

space.  For aesthetic reasons, the first token on each non-directive

line of output is preceded with sufficient spaces that it appears in the

same column as it did in the original source file.



     </p><li>The numeric value of character constants in preprocessor expressions.



     <p>The preprocessor and compiler interpret character constants in the

same way; i.e. escape sequences such as <code>\a</code> are given the

values they would have on the target machine.



     <p>The compiler values a multi-character character constant a character

at a time, shifting the previous value left by the number of bits per

target character, and then or-ing in the bit-pattern of the new

character truncated to the width of a target character.  The final

bit-pattern is given type <code>int</code>, and is therefore signed,

regardless of whether single characters are signed or not (a slight

change from versions 3.1 and earlier of GCC).  If there are more

characters in the constant than would fit in the target <code>int</code> the

compiler issues a warning, and the excess leading characters are

ignored.



     <p>For example, 'ab' for a target with an 8-bit <code>char</code> would be

interpreted as (int)&nbsp;((unsigned&nbsp;char)&nbsp;'a'&nbsp;*&nbsp;256&nbsp;+&nbsp;(unsigned&nbsp;char)&nbsp;'b'), and '\234a' as (int)&nbsp;((unsigned&nbsp;char)&nbsp;'\234'&nbsp;*&nbsp;256&nbsp;+&nbsp;(unsigned&nbsp;char)&nbsp;'a').



     </p><li>Source file inclusion.



     <p>For a discussion on how the preprocessor locates header files,

<a href="Include-Operation.html#Include%20Operation">Include Operation</a>.



     </p><li>Interpretation of the filename resulting from a macro-expanded

<code>#include</code> directive.



     <p>See <a href="Computed-Includes.html#Computed%20Includes">Computed Includes</a>.



     </p><li>Treatment of a <code>#pragma</code> directive that after macro-expansion

results in a standard pragma.



     <p>No macro expansion occurs on any <code>#pragma</code> directive line, so the

question does not arise.



     <p>Note that GCC does not yet implement any of the standard

pragmas.



   </ul>



   </body></html>



⌨️ 快捷键说明

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