------- Comment #2 from _deepfire at feelingofgreen dot ru  2008-02-23 11:56 
-------
> I think this is correct CPP behavior.
> it only evaluates one level of _ .

Interesting, reading the CPP manual[1] gives me an impression that there is
at least intent to support nested expansions:

> You might wonder, “Why mention the prescan, if it makes no difference? 
> And why not skip it and make the preprocessor faster?” The answer is 
> that the prescan does make a difference in three special cases:
>
>    * Nested calls to a macro.
>
>      We say that nested calls to a macro occur when a macro's argument 
> contains a call to that very macro. For example, if f is a macro that expects 
> one argument, f (f (1)) is a nested pair of calls to f. The desired expansion 
> is  made by expanding f (1) and substituting that into the definition of f. 
> The prescan causes the expected result to happen. Without the prescan, f (1) 
> itself  would be substituted as an argument, and the inner use of f would 
> appear during the main scan as an indirect self-reference and would not be 
> expanded. 

But in my case the nesting is not immediately observable, and therefore
requires further body expansion to detect and apply that strategy.

I wonder what will be the final call of GCC people on that -- will this
use pattern be considered legit-enough to deserve support, or not.

1. http://gcc.gnu.org/onlinedocs/cpp/Argument-Prescan.html#Argument-Prescan


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35301

Reply via email to