[cfe-dev] Clang-cl.exe and the VC++ preprocessor

Daniel James daniel at calamity.org.uk
Sat Jul 12 02:10:06 PDT 2014


On 12 July 2014 03:22, Zachary Turner <zturner at google.com> wrote:
> On Fri, Jul 11, 2014 at 1:52 PM, Alp Toker <alp at nuanti.com> wrote:
>>
>>
>> The only hangup would be uncertainty around the interface to enable it
>> (pragmas, what syntax? filename regex?) and maintainability. It's the kind
>> of feature that's easy to implement, but burdensome to keep tested and
>> stable, especially since we have no automated MSVC header integration tests.
>
>
> Something similar to how #pragma pack works sounds useful here.
>
> #pragma msvc_pp_compat(push)
> #pragma msvc_pp_compat(on)
>
> ...
>
> #pragma msvc_pp_compat(pop)

When a macro is defined at a point where compatibility mode is off,
but expanded at a point where it's on, which mode would it use?

Incidentally, is it likely that further compatibility changes will be
made? My brief testing suggests that clang-cl is currently closer to a
standards-compliant preprocessor than Visual C++'s preprocessor.



More information about the cfe-dev mailing list