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

Eli Zaretskii
2017-05-26T12:57:32Z

> Cc: brobecker@adacore.com, simon.marchi@polymtl.ca, gdb-patches@sourceware.org
> From: Pedro Alves <palves@redhat.com>
> Date: Fri, 26 May 2017 12:52:27 +0100
>
> My understanding of the issue is that libstdc++ had a too-coarse way
> to tell whether the runtime supports C99, and that ended up disabling
> std::to_string because some unrelated (to std::to_string) bits of C99
> support are missing in mingw.org.

That's another problem, but it doesn't matter in the case of MinGW,
because the root cause was indeed affecting std::to_string, AFAIU.

> I don't think the fix on the GCC side really requires a mingw runtime
> update. I may well be wrong, of course.

I think you are wrong. In the libstdc++ 5.3.0 distribution, the
offending defines are in include/c++/mingw32/bits/c++config.h, which
AFAIU is generated at libstdc++ build time.

> I cloned the current mingw sources to see what's been done
> over there, and here's what's there now (on the 5.0-active branch):

You could have just downloaded the MinGW runtime from here:

https://sourceforge.net/projects/mingw/files/MinGW/Base/mingwrt/mingwrt-5.0/libmingwex-5.0-mingw32-dev.tar.xz/download

> #if _ISOC99_SOURCE && __cplusplus >= 201103L && __GNUC__ < 6
> /* Due to a configuration defect in GCC versions prior to GCC-6, when
> * compiling C++11 code, the ISO-C99 functions may not be incorporated
> * into the appropriate namespace(s); we may be able to mitigate this,
> * by ensuring that these GCC configuration macros are defined.
> */
> # define _GLIBCXX_USE_C99 1
> # define _GLIBCXX_HAVE_WCSTOF 1
> #endif
>
> I would have helped a lot if I had been shown this. Note the
> "__GNUC__ < 6" check.

Hey, that's unfair! You expect me to look at the MinGW64 headers and
at related Bugzilla bugs, but you yourself cannot look in the MinGW
headers?

> If you're happy with the gdb fix in place now, I'm happy enough
> with it too.

I'm happy. Any problems with MinGW GCC 6.x don't matter as long as
there's no such GCC version on the MinGW site.