[llvm-dev] problem (and fix) with -fms-extensions

Dimitry Andric via llvm-dev
Fri, 12 May 2017 12:35:21 -0000

On 12 May 2017, at 12:28, Marc Espie <espie at nerim.net>
wrote:
>
> On Fri, May 12, 2017 at 12:01:35PM +0200, Dimitry Andric wrote:
>> On 11 May 2017, at 20:04, Marc Espie via llvm-dev <llvm-dev at
lists.llvm.org> wrote:
...
>>> +  if (LangOpts.MicrosoftMode)
>>> +    Builder.defineMacro("__ms_extensions__", 1);
>>>  if (!LangOpts.CPlusPlus) {
>>>    if (LangOpts.C11)
>>>      Builder.defineMacro("__STDC_VERSION__",
"201112L");
>>
>> Looks fine to me, though you would also have to convince the gcc
authors
>> to do the same.  (That is, if you still want to use recent gcc's...
:)
>
> Well, the licence means we care a little less about gcc for obvious
reasons.
> Working with the llvm/clang community makes more sense for us.

Another option, which works right away, without having to modify any
compiler, is to just define it on the command line, e.g. use:
-fms-extensions -D__ms_extensions__

-Dimitry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: Message signed with OpenPGP
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20170512/4c8bce0b/attachment.sig>