[cfe-dev] Some MS extensions can't be disabled?
Douglas Gregor
dgregor at apple.com
Fri Mar 5 13:41:04 PST 2010
On Mar 1, 2010, at 2:32 AM, Andrius Morkūnas wrote:
> Hi,
>
> I've ran into a weird problem:
> error: declaration does not declare anything
> typedef int __ptr64;
> ^~~~~~~~~~~
>
> After some looking at the source code I found that __ptr64 is one of the
> Microsoft extensions' keywords, but it isn't disabled (and can't be?) on
> FreeBSD.
>
> In include/clang/Basic/TokenKinds.def:
>
> // Microsoft Extension.
> KEYWORD(__declspec , KEYALL)
> KEYWORD(__cdecl , KEYALL)
> KEYWORD(__stdcall , KEYALL)
> KEYWORD(__fastcall , KEYALL)
> KEYWORD(__ptr64 , KEYALL)
> KEYWORD(__w64 , KEYALL)
> KEYWORD(__forceinline , KEYALL)
> <...>
> // Microsoft extensions which should be disabled in strict conformance mode
> ALIAS("_asm" , asm , KEYMS)
> ALIAS("_cdecl" , __cdecl , KEYMS)
> ALIAS("_fastcall" , __fastcall , KEYMS)
> ALIAS("_stdcall" , __stdcall , KEYMS)
>
> Is there some reason why *all* of MS extensions aren't disabled by default?
I think we might actually see __stdcall/__cdecl/__fastcall out there in code that isn't meant to require -fms-extensions. So, I've switched __ptr64 and __w64 over to -fms-extensions only:
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20100301/028176.html
- Doug
More information about the cfe-dev
mailing list