r216270 - -fms-extensions: Alias _intNN to __intNN

Reid Kleckner rnk at google.com
Fri Aug 22 10:56:36 PDT 2014


We could, but we don't have MS compatibility in these token flags. We would
have to add a flag or implement these as identifier hacks in the parser.

Is it worth it? We also have all of these aliases which are just as
non-conforming:
ALIAS("_cdecl"           , __cdecl    , KEYMS | KEYBORLAND)
ALIAS("_fastcall"        , __fastcall , KEYMS | KEYBORLAND)
ALIAS("_stdcall"         , __stdcall  , KEYMS | KEYBORLAND)
ALIAS("_thiscall"        , __thiscall , KEYMS)
ALIAS("_uuidof"          , __uuidof   , KEYMS | KEYBORLAND)
ALIAS("_inline"          , inline     , KEYMS)
ALIAS("_declspec"        , __declspec , KEYMS)

Throwing these all under -fms-compatibility feels slightly pedantic.


On Fri, Aug 22, 2014 at 10:38 AM, Richard Smith <richard at metafoo.co.uk>
wrote:

> This is not a conforming extension. Should it be under -fms-compatibility
> instead?
> On 22 Aug 2014 10:15, "Reid Kleckner" <reid at kleckner.net> wrote:
>
>> Author: rnk
>> Date: Fri Aug 22 11:52:57 2014
>> New Revision: 216270
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=216270&view=rev
>> Log:
>> -fms-extensions: Alias _intNN to __intNN
>>
>> Fixes build for SPEC 2000 CPU. MSVC disables these aliases under /Za,
>> which enables stricter standards compliance. We don't currently have any
>> way to disable them.
>>
>> Patch by Kevin Smith!
>>
>> Modified:
>>     cfe/trunk/include/clang/Basic/TokenKinds.def
>>     cfe/trunk/test/Parser/MicrosoftExtensions.cpp
>>
>> Modified: cfe/trunk/include/clang/Basic/TokenKinds.def
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/TokenKinds.def?rev=216270&r1=216269&r2=216270&view=diff
>>
>> ==============================================================================
>> --- cfe/trunk/include/clang/Basic/TokenKinds.def (original)
>> +++ cfe/trunk/include/clang/Basic/TokenKinds.def Fri Aug 22 11:52:57 2014
>> @@ -545,8 +545,12 @@ KEYWORD(__multiple_inheritance        ,
>>  KEYWORD(__virtual_inheritance         , KEYMS)
>>  KEYWORD(__interface                   , KEYMS)
>>  ALIAS("__int8"           , char       , KEYMS)
>> +ALIAS("_int8"            , char       , KEYMS)
>>  ALIAS("__int16"          , short      , KEYMS)
>> +ALIAS("_int16"           , short      , KEYMS)
>>  ALIAS("__int32"          , int        , KEYMS)
>> +ALIAS("_int32"           , int        , KEYMS)
>> +ALIAS("_int64"           , __int64    , KEYMS)
>>  ALIAS("__wchar_t"        , wchar_t    , KEYMS)
>>  ALIAS("_asm"             , asm        , KEYMS)
>>  ALIAS("_alignof"         , __alignof  , KEYMS)
>>
>> Modified: cfe/trunk/test/Parser/MicrosoftExtensions.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/MicrosoftExtensions.cpp?rev=216270&r1=216269&r2=216270&view=diff
>>
>> ==============================================================================
>> --- cfe/trunk/test/Parser/MicrosoftExtensions.cpp (original)
>> +++ cfe/trunk/test/Parser/MicrosoftExtensions.cpp Fri Aug 22 11:52:57 2014
>> @@ -226,6 +226,11 @@ void interface_test() {
>>  }
>>
>>  __int64 x7 = __int64(0);
>> +_int64 x8 = _int64(0);
>> +static_assert(sizeof(_int64) == 8, "");
>> +static_assert(sizeof(_int32) == 4, "");
>> +static_assert(sizeof(_int16) == 2, "");
>> +static_assert(sizeof(_int8) == 1, "");
>>
>>  int __identifier(generic) = 3;
>>  int __identifier(int) = 4;
>>
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140822/4eb8905f/attachment.html>


More information about the cfe-commits mailing list