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

Alp Toker alp at nuanti.com
Fri Jul 11 13:52:42 PDT 2014


On 11/07/2014 18:32, Jonathan 'Rynn' Sauer wrote:
> Hello,
>
>> Also it's worth pointing out that the idea is not to emulate VC++ in every respect.  Only in every respect where not doing so will break vast amounts of code.  There are plenty of places where not emulating VC++ will *fix* vasts amounts of code.  I imagine the goal is to depart with VC++ in those respects.
>>
>> There are examples where not emulating VC++'s bugs means **we can't even include standard windows headers**.  Surely we agree that a Windows compiler that cannot include <windows.h> would not be particularly useful.
> Could it be an option to limit the emulation of VC++'s preprocessor to system headers and macros defined
> there, similar to how clang suppresses warnings in these cases?

Yes, this would be possible, almost trivial to do in clang's preprocessor.

There are currently 10 MSVC bug-for-bug behaviours, and 12 benign 
Microsoft language extensions implemented in the lexer/preprocessor.

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.

Alp.


>
>
> Jonathan
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

-- 
http://www.nuanti.com
the browser experts




More information about the cfe-dev mailing list