{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Where there are differences they generally represent

Info iconThis preview shows pages 59–61. Sign up to view the full content.

View Full Document Right Arrow Icon
Where there are differences, they generally represent bugs in the snapshots. -I- deprecated This option has been deprecated in 4.0. ‘ -iquote ’ is meant to replace the need for this option. Order of evaluation of ‘ # ’ and ‘ ## ’ operators The standard does not specify the order of evaluation of a chain of ‘ ## ’ operators, nor whether ‘ # ’ is evaluated before, after, or at the same time as ‘ ## ’. 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. An example of where this might matter is pasting the arguments ‘ 1 ’, ‘ e ’ and ‘ -2 ’. This would be fine for left-to-right pasting, but right-to-left pasting would produce an invalid token ‘ e-2 ’. GCC 3.0 evaluates ‘ # ’ and ‘ ## ’ at the same time and strictly left to right. Older versions evaluated all ‘ # ’ operators first, then all ‘ ## ’ operators, in an unreliable order. The form of whitespace between tokens in preprocessor output See Chapter 9 [Preprocessor Output], page 47 , 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. 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. Optional argument when invoking rest argument macros 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. ## ’ swallowing preceding text in rest argument macros Formerly, in a macro expansion, if ‘ ## ’ 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 ( not the preceding token). This extension is in direct conflict with the 1999 C standard and has been drastically pared back. In the current version of the preprocessor, if ‘ ## ’ appears between a comma and a vari- able 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 ‘ ## ’ is not a comma, then ‘ ## ’ behaves as a normal token paste.
Background image of page 59

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Chapter 12: Invocation 56 #line ’ and ‘ #include The ‘ #line ’ directive used to change GCC’s notion of the “directory containing the current file”, used by ‘ #include ’ with a double-quoted header file name. In 3.0 and later, it does not. See Chapter 6 [Line Control], page 44 , for further explanation.
Background image of page 60
Image of page 61
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}