| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <html> |
| <!-- Copyright (C) 1987-2015 Free Software Foundation, Inc. |
| |
| Permission is granted to copy, distribute and/or modify this document |
| under the terms of the GNU Free Documentation License, Version 1.3 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". |
| |
| This manual contains no Invariant Sections. The Front-Cover Texts are |
| (a) (see below), and the Back-Cover Texts are (b) (see below). |
| |
| (a) The FSF's Front-Cover Text is: |
| |
| A GNU Manual |
| |
| (b) The FSF's Back-Cover Text is: |
| |
| 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. --> |
| <!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ --> |
| <head> |
| <title>The C Preprocessor: Differences from previous versions</title> |
| |
| <meta name="description" content="The C Preprocessor: Differences from previous versions"> |
| <meta name="keywords" content="The C Preprocessor: Differences from previous versions"> |
| <meta name="resource-type" content="document"> |
| <meta name="distribution" content="global"> |
| <meta name="Generator" content="makeinfo"> |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| <link href="index.html#Top" rel="start" title="Top"> |
| <link href="Index-of-Directives.html#Index-of-Directives" rel="index" title="Index of Directives"> |
| <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents"> |
| <link href="Implementation-Details.html#Implementation-Details" rel="up" title="Implementation Details"> |
| <link href="Invocation.html#Invocation" rel="next" title="Invocation"> |
| <link href="Obsolete-Features.html#Obsolete-Features" rel="prev" title="Obsolete Features"> |
| <style type="text/css"> |
| <!-- |
| a.summary-letter {text-decoration: none} |
| blockquote.smallquotation {font-size: smaller} |
| div.display {margin-left: 3.2em} |
| div.example {margin-left: 3.2em} |
| div.indentedblock {margin-left: 3.2em} |
| div.lisp {margin-left: 3.2em} |
| div.smalldisplay {margin-left: 3.2em} |
| div.smallexample {margin-left: 3.2em} |
| div.smallindentedblock {margin-left: 3.2em; font-size: smaller} |
| div.smalllisp {margin-left: 3.2em} |
| kbd {font-style:oblique} |
| pre.display {font-family: inherit} |
| pre.format {font-family: inherit} |
| pre.menu-comment {font-family: serif} |
| pre.menu-preformatted {font-family: serif} |
| pre.smalldisplay {font-family: inherit; font-size: smaller} |
| pre.smallexample {font-size: smaller} |
| pre.smallformat {font-family: inherit; font-size: smaller} |
| pre.smalllisp {font-size: smaller} |
| span.nocodebreak {white-space:nowrap} |
| span.nolinebreak {white-space:nowrap} |
| span.roman {font-family:serif; font-weight:normal} |
| span.sansserif {font-family:sans-serif; font-weight:normal} |
| ul.no-bullet {list-style: none} |
| --> |
| </style> |
| |
| |
| </head> |
| |
| <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000"> |
| <a name="Differences-from-previous-versions"></a> |
| <div class="header"> |
| <p> |
| Previous: <a href="Obsolete-Features.html#Obsolete-Features" accesskey="p" rel="prev">Obsolete Features</a>, Up: <a href="Implementation-Details.html#Implementation-Details" accesskey="u" rel="up">Implementation Details</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index-of-Directives.html#Index-of-Directives" title="Index" rel="index">Index</a>]</p> |
| </div> |
| <hr> |
| <a name="Differences-from-previous-versions-1"></a> |
| <h3 class="section">11.4 Differences from previous versions</h3> |
| <a name="index-differences-from-previous-versions"></a> |
| |
| <p>This section details behavior which has changed from previous versions |
| of CPP. We do not plan to change it again in the near future, but |
| we do not promise not to, either. |
| </p> |
| <p>The “previous versions” discussed here are 2.95 and before. The |
| behavior of GCC 3.0 is mostly the same as the behavior of the widely |
| used 2.96 and 2.97 development snapshots. Where there are differences, |
| they generally represent bugs in the snapshots. |
| </p> |
| <ul> |
| <li> -I- deprecated |
| |
| <p>This option has been deprecated in 4.0. <samp>-iquote</samp> is meant to |
| replace the need for this option. |
| </p> |
| </li><li> Order of evaluation of ‘<samp>#</samp>’ and ‘<samp>##</samp>’ operators |
| |
| <p>The standard does not specify the order of evaluation of a chain of |
| ‘<samp>##</samp>’ operators, nor whether ‘<samp>#</samp>’ is evaluated before, after, or |
| at the same time as ‘<samp>##</samp>’. You should therefore not write any code |
| which depends on any specific ordering. It is possible to guarantee an |
| ordering, if you need one, by suitable use of nested macros. |
| </p> |
| <p>An example of where this might matter is pasting the arguments ‘<samp>1</samp>’, |
| ‘<samp>e</samp>’ and ‘<samp>-2</samp>’. This would be fine for left-to-right pasting, |
| but right-to-left pasting would produce an invalid token ‘<samp>e-2</samp>’. |
| </p> |
| <p>GCC 3.0 evaluates ‘<samp>#</samp>’ and ‘<samp>##</samp>’ at the same time and strictly |
| left to right. Older versions evaluated all ‘<samp>#</samp>’ operators first, |
| then all ‘<samp>##</samp>’ operators, in an unreliable order. |
| </p> |
| </li><li> The form of whitespace between tokens in preprocessor output |
| |
| <p>See <a href="Preprocessor-Output.html#Preprocessor-Output">Preprocessor Output</a>, for the current textual format. This is |
| also the format used by stringification. Normally, the preprocessor |
| communicates tokens directly to the compiler’s parser, and whitespace |
| does not come up at all. |
| </p> |
| <p>Older versions of GCC preserved all whitespace provided by the user and |
| inserted lots more whitespace of their own, because they could not |
| accurately predict when extra spaces were needed to prevent accidental |
| token pasting. |
| </p> |
| </li><li> Optional argument when invoking rest argument macros |
| |
| <p>As an extension, GCC permits you to omit the variable arguments entirely |
| when you use a variable argument macro. This is forbidden by the 1999 C |
| standard, and will provoke a pedantic warning with GCC 3.0. Previous |
| versions accepted it silently. |
| </p> |
| </li><li> ‘<samp>##</samp>’ swallowing preceding text in rest argument macros |
| |
| <p>Formerly, in a macro expansion, if ‘<samp>##</samp>’ appeared before a variable |
| arguments parameter, and the set of tokens specified for that argument |
| in the macro invocation was empty, previous versions of CPP would |
| back up and remove the preceding sequence of non-whitespace characters |
| (<strong>not</strong> the preceding token). This extension is in direct |
| conflict with the 1999 C standard and has been drastically pared back. |
| </p> |
| <p>In the current version of the preprocessor, if ‘<samp>##</samp>’ appears between |
| a comma and a variable arguments parameter, and the variable argument is |
| omitted entirely, the comma will be removed from the expansion. If the |
| variable argument is empty, or the token before ‘<samp>##</samp>’ is not a |
| comma, then ‘<samp>##</samp>’ behaves as a normal token paste. |
| </p> |
| </li><li> ‘<samp>#line</samp>’ and ‘<samp>#include</samp>’ |
| |
| <p>The ‘<samp>#line</samp>’ directive used to change GCC’s notion of the |
| “directory containing the current file”, used by ‘<samp>#include</samp>’ with |
| a double-quoted header file name. In 3.0 and later, it does not. |
| See <a href="Line-Control.html#Line-Control">Line Control</a>, for further explanation. |
| </p> |
| </li><li> Syntax of ‘<samp>#line</samp>’ |
| |
| <p>In GCC 2.95 and previous, the string constant argument to ‘<samp>#line</samp>’ |
| was treated the same way as the argument to ‘<samp>#include</samp>’: backslash |
| escapes were not honored, and the string ended at the second ‘<samp>"</samp>’. |
| This is not compliant with the C standard. In GCC 3.0, an attempt was |
| made to correct the behavior, so that the string was treated as a real |
| string constant, but it turned out to be buggy. In 3.1, the bugs have |
| been fixed. (We are not fixing the bugs in 3.0 because they affect |
| relatively few people and the fix is quite invasive.) |
| </p> |
| </li></ul> |
| |
| <hr> |
| <div class="header"> |
| <p> |
| Previous: <a href="Obsolete-Features.html#Obsolete-Features" accesskey="p" rel="prev">Obsolete Features</a>, Up: <a href="Implementation-Details.html#Implementation-Details" accesskey="u" rel="up">Implementation Details</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index-of-Directives.html#Index-of-Directives" title="Index" rel="index">Index</a>]</p> |
| </div> |
| |
| |
| |
| </body> |
| </html> |