[PATCH] Enable libstdc++ numeric conversions on Cygwin

Jonathan Wakely jwakely@redhat.com
Thu Nov 12 14:50:00 GMT 2015


On 12/11/15 13:39 +0000, Jonathan Wakely wrote:
>One downside of this change is that we introduce some (hopefully safe)
>ODR violations, where inline functions and templates that depend on
>_GLIBCXX_USE_C99_FOO might now be defined differently in C++98 and
>C++11 code. Previously they had the same definition, even though in
>C++11 mode the value of the _GLIBCXX_USE_C99_FOO macro might have been
>sub-optimal (i.e. the C99 features were usable, but the macro said
>they weren't). Those ODR violatiosn could be avoided if needed, by
>always using the _GLIBCXX98_USE_C99_FOO macro in code that can be
>included from either C++98 or C++11. We could still use the
>_GLIBCXX11_USE_C99_FOO macro in pure C++11 code (such as the numeric
>conversion functions) and get most of the benefit of this change.

This patch (relative to the previous one) would avoid the ODR
problems, by only using the C++98 macro in code that gets used in
C++98 and later, and using the _GLIBCXX11_XXX ones in code that is
never compiled as C++98 (specifically, the numeric conversion
functions).

Maybe this is a safer, more conservative change.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 7471 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20151112/bb4814bb/attachment.bin>


More information about the Gcc-patches mailing list