[cfe-commits] r142797 - in /cfe/trunk: lib/Frontend/CompilerInvocation.cpp test/Lexer/ms-extensions.c
dgregor at apple.com
Mon Oct 24 10:31:01 PDT 2011
On Oct 24, 2011, at 9:53 AM, David Blaikie wrote:
>> Make -fms-compatibility imply -fms-extensions. Fixes PR11204.
> Is this the right way to go? I could see extensions implying
> compatibility (do we do this already? or is it intentional that one
> might use ms-extensions without ms-compatibly?) but the other way
> around seems less obvious to me. I may need to be able to compile with
> MSVC (compatibility) but I don't want to dig a deeper hole
> (extensions). I suppose if I cared I just wouldn't enable either &
> check my code on both compilers & use the subset of functionality
> across them, is that the line of reasoning? (though that doesn't quite
> cover cases where the same code compiles in both compilers but behaves
> differently due to lookup, etc).
-fms-extensions = allow Microsoft extensions without sacrificing language conformance
-fms-compatibility = do crazy non-standard things to try to eat the broken code that Microsoft's compiler accepts. In other words, try to be as MSVC-like as Clang can be.
In other words, when you turn on -fms-compatibility, you've already thrown standards conformance out the window, so you might as well get the (relatively safe) -fms-extensions along with it.
More information about the cfe-commits