[AD] escaping newlines and cpp reentrance

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


This is an excerpt from the C++ draft. It is not C, but the odds that C
behaves differently at preprocessor level are thin, I'd say. Note the last
point.


  16.3.4  Rescanning and further replacement                [cpp.rescan]

1 After  all  parameters  in the replacement list have been substituted,
  the resulting preprocessing token sequence is rescanned with all  sub-
  sequent  preprocessing  tokens of the source file for more macro names
  to replace.

2 If the name of the macro being replaced is found during this  scan  of
  the replacement list (not including the rest of the source file's pre-
  processing tokens), it  is  not  replaced.   Further,  if  any  nested
  replacements encounter the name of the macro being replaced, it is not

  replaced.  These nonreplaced macro name preprocessing  tokens  are  no
  longer  available  for  further  replacement  even  if  they are later
  (re)examined in contexts in which that macro name preprocessing  token
  would otherwise have been replaced.

3 The  resulting  completely macro-replaced preprocessing token sequence
  is not processed as a preprocessing directive  even  if  it  resembles
  one.

-- 
Lyrian 



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/