Re: GDB 7.99.91 MinGW compilation error in cli-script.c

Pedro Alves
2017-05-23T09:53:50Z

On 05/22/2017 07:42 PM, Eli Zaretskii wrote:
>> Cc: brobecker@adacore.com, simon.marchi@polymtl.ca, gdb-patches@sourceware.org
>> From: Pedro Alves <palves@redhat.com>
>> Date: Mon, 22 May 2017 16:26:19 +0100
>>
>> Is there still a reason for the "#include <_mingw.h>"?
>
> Yes, that's where _GLIBCXX_USE_C99 is defined.

Urgh...

>
>> Otherwise, if
>>
>> - older broken mingw releases get the replacement
>> - newer fixed mingw releases don't get the replacement
>> - mingw-w64 doesn't get the replacement (as it doesn't need one IIUC)
>>
>> then it's fine with me.
>
> Hmmm... I see that MinGW64 doesn't define _GLIBCXX_USE_C99 in its
> system headers,

I'm surprised mingw does this, because that's a libstdc++
internal symbol...

> so I guess I will have to add the
> __MINGW64_VERSION_MAJOR guard as well.

Please also take a look at the fix for:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58393

which suggests to me that newer compilers against older mingw
might actually be fixed, independently of the _GLIBCXX_USE_C99 hack?

>
>> It'd be useful for the archives if you expanded on which mingw versions
>> and compilers you tested this on. Also likewise a short comment to
>> the effect in the code would be likewise handy for future readers
>
> OK, will do.
>
>> (please use /**/ style comments).
>
> I thought I did...

The comments you had added in the original patch used // style:

+// For versions of mingw.org's MinGW runtime before 5.0, make sure
+// libstdc++ headers don't omit portions that require C99.

Thanks,
Pedro Alves