[cfe-dev] Macro expansion weirdness (or bug?)

Chris Lattner clattner at apple.com
Fri Mar 26 10:50:39 PDT 2010


On Mar 26, 2010, at 10:26 AM, Abramo Bagnara wrote:

> Il 26/03/2010 18:07, Chris Lattner ha scritto:
>> 
>> On Mar 25, 2010, at 4:32 PM, Abramo Bagnara wrote:
>> 
>>> Il 25/03/2010 20:43, Chris Lattner ha scritto:
>>>> 
>>>> On Mar 25, 2010, at 12:08 PM, Abramo Bagnara wrote:
>>>> 
>>>>> 
>>>>> From your message it seems you're expecting *more* callback
>>>>> invocations in the first sample, while I'd expect *less* callback
>>>>> invocations in the second sample.
>>>>> 
>>>>> Could you explain better your position?
>>>> 
>>>> My position is basically that the preprocessor is incredibly
>>>> scary/confusing and implementing it damaged me.  :)
>>>> 
>>>> I don't recall enough of the details to really say which way is right
>>>> or wrong, but tokens coming out at -E is a good indicator that the
>>>> right thing is happening.
>>> 
>>> Indeed it was missing further expansion disabling in a case where
>>> isTrivialSingleTokenExpansion is true.
>> 
>> Please provide a testcase that this fixes with -E.
> 
> ... such a man of little faith :-D

"damaged" remember? :)

> 
> #define n(v) v
> #define l m
> #define m l a
> n(m)
> 

Excellent, thanks for the patch.  Applied here:
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20100322/028781.html

-Chris



More information about the cfe-dev mailing list