[cfe-commits] [patch] Emulate MSVC's preprocessor macro argument separator behavior

Aaron Ballman aaron at aaronballman.com
Sun Aug 26 15:49:37 PDT 2012


On Sun, Aug 26, 2012 at 6:22 PM, João Matos <ripzonetriton at gmail.com> wrote:
> Only thing I found is one bug report about it on MSDN:
> http://social.msdn.microsoft.com/Forums/pl-PL/vclanguage/thread/23f682bf-8421-474a-aa38-e32f9a0b728f

That's what I was afraid of.  :-/

We don't want to be bug for bug compatible with MSVC, and this is
their bug.  But then again, this is preventing us from compiling
standard headers for VS 2012, so we need to do something about it...

I guess I would be most comfortable if we tied this to the version of
MSVC we're trying to compile for (a la the _MSC_VER macro) so in the
event of Microsoft fixing the bug, we can stop supporting the behavior
at some point.  Aside from that, the patch LGTM.

Thanks for tackling this!

~Aaron

>
> On Sun, Aug 26, 2012 at 11:13 PM, Aaron Ballman <aaron at aaronballman.com>
> wrote:
>>
>> I don't suppose this behavior is documented anywhere on MSDN, is it?
>>
>> ~Aaron
>>
>> On Sun, Aug 26, 2012 at 5:29 PM, João Matos <ripzonetriton at gmail.com>
>> wrote:
>> > Attached is a patch that implements an odd MSVC behaviour when handling
>> > commas that come from nested macro expansions.
>> >
>> > This behavior is well explained in the following post:
>> >
>> >
>> > http://stackoverflow.com/questions/11469462/difference-between-gcc-and-microsoft-preprocessor
>> >
>> > This is needed to correctly handle the new standard library headers in
>> > VS
>> > 2012.
>> >
>> >
>> > --
>> > João Matos
>> >
>> > _______________________________________________
>> > cfe-commits mailing list
>> > cfe-commits at cs.uiuc.edu
>> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>> >
>
>
>
>
> --
> João Matos




More information about the cfe-commits mailing list