Where there are differences they generally represent

Info icon This 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.
Image of page 59

Info icon This 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.
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 ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern