[cfe-dev] Some MS extensions can't be disabled?

Andrius Morkūnas hinokind at gmail.com
Mon Mar 1 02:32:21 PST 2010


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?

-- 
Andrius



More information about the cfe-dev mailing list