[PATCH] Enable libstdc++ numeric conversions on Cygwin

Jonathan Wakely jwakely@redhat.com
Thu Nov 12 17:56:00 GMT 2015


On 12/11/15 12:24 -0500, Jennifer Yao wrote:
>> 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.
>
>I haven't tested either of your patches yet (the testsuite runs
>reeeeally slowly on Cygwin T___T), but I just wanted to express my
>approval of the proposed changes (more specifically, the second patch
>you posted).

The second one doesn't work sadly. If you're going to test, pelase
test the first patch only.

>Also, I was not aware that we had to worry about C++03 compatibility.
>Sounds tedious.

It is :-\




More information about the Libstdc++ mailing list