This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [fixincludes, v3] Enable full ISO C99 support for C++ on Solaris 10+
- From: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- To: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org, Bruce Korb <bkorb at gnu dot org>
- Date: Mon, 21 Jun 2010 17:46:41 +0200
- Subject: Re: [fixincludes, v3] Enable full ISO C99 support for C++ on Solaris 10+
- References: <ydd4oi6yxl4.fsf@manam.CeBiTec.Uni-Bielefeld.DE> <AANLkTimWPtRlFyqRRfIf8GulgWZZajMjro3KAa6SZWzx@mail.gmail.com> <yddwrv1xw9e.fsf@manam.CeBiTec.Uni-Bielefeld.DE> <AANLkTil1O8GQ590c9TW3Istogp6H2olfUVNErvAh16nd@mail.gmail.com> <AANLkTil7QoMM6Nl2PM1RbwC1xm66s0cmPBb4A87Ev13W@mail.gmail.com> <ydd39xmvqf6.fsf@manam.CeBiTec.Uni-Bielefeld.DE>
Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:
> Jonathan Wakely <jwakely.gcc@gmail.com> writes:
>
>> On 19 May 2010 18:42, Jonathan Wakely wrote:
>>>
>>> The problem is I defined a "::wait" function which clashes with
>>> wait(2). ÂThe fix is to rename that function.
>>
>> Fixed on trunk. If you apply your changes to a branch then backporting
>> the testsuite fixes is pre-approved.
>
> Thanks. Unfortunately, I've never received any comment on the libstdc++
> side of patch applicability to the 4.4 and 4.5 branches.
>
> Solaris 9/SPARC testing (with gas and TLS enabled to work around PR
> target/44132) revealed that the
> 26_numerics/headers/cmath/c99_classification_macros_c.c test XPASSes
> there, so I'll xfail it only on Solaris 10+. Otherwise, C++ and
> libstdc++ test results are clean, so it seems the patch has no ill
> effects on earlier (pre-C99) Solaris versions.
>
> Solaris 8/SPARC and Solaris 8/9 x86 testing is still in progress.
I've finally gotten around to finishing this:
* As the testcase XPASSed on Solaris 8 and 9, I'm only XFAILing on
Solaris 10 and up.
* Comparing libstdc++-v3 config.h before and after the patch, I noticed
that there is one unexpected change:
/* Define to 1 if you have the `isnan' function. */
-#define HAVE_ISNAN 1
+/* #undef HAVE_ISNAN */
This happens because <math.h> includes <iso/math_c99.h> now, which has
/*
* C99 7.12.3 classification macros
*/
#undef isnan
#if __GNUC__ >= 4
#define isnan(x) __builtin_isnan(x)
#else
#define isnan(x) __extension__( \
{ __typeof(x) __x_n = (x); \
__builtin_isunordered(__x_n, __x_n); })
#endif
and compiling the configure testcode errors now:
% cat isnan.cpp
#include <math.h>
int
main (void)
{
isnan (0);
return 0;
}
% gcc -c -fno-builtin -D_GNU_SOURCE isnan.cpp
isnan.cpp: In function 'int main()':
isnan.cpp:6:3: error: non-floating-point argument in call to function '__builtin_isnan'
which is correct, of course. This seems to be a bug in linkage.m4
(GLIBCXX_CHECK_MATH_DECL_1), which passes 0 to the function under
test instead of 0.0.
Anyway, I've checked in the patch and will fix this up as a followup
once it has been agreed that passing 0.0 instead is the right way to
handle this.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University