This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [fixincludes, v3] Don't define libstdc++-internal macros in Solaris 10+ <math.h>
- From: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- To: Bruce Korb <bkorb at gnu dot org>
- Cc: gcc-patches at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org, John David Anglin <dave dot anglin at bell dot net>
- Date: Fri, 11 Nov 2016 11:03:25 +0100
- Subject: Re: [fixincludes, v3] Don't define libstdc++-internal macros in Solaris 10+ <math.h>
- Authentication-results: sourceware.org; auth=none
- References: <yddy410lkld.fsf@CeBiTec.Uni-Bielefeld.DE> <b3911191-dc9b-ef1f-ce49-405edfc55e33@gnu.org>
Hi Bruce,
> On 11/03/16 07:11, Rainer Orth wrote:
>>
>> Ok for mainline now, and for backports to the gcc-6 and gcc-5 branches
>> after some soak time?
>
> Yes, please. Thanks.
unfortunately, I didn't look closly enough when checking for failures.
There is one which I thought was preexisting:
math.h /vol/gcc/src/hg/trunk/local/fixincludes/tests/base/math.h differ: char 1135, line 57
*** math.h Thu Nov 10 22:32:14 2016
--- /vol/gcc/src/hg/trunk/local/fixincludes/tests/base/math.h Thu Nov 10 18:49:36 2016
***************
*** 54,61 ****
--- 54,63 ----
#if defined( HPUX11_FABSF_CHECK )
#ifdef _PA_RISC
+ #ifndef __cplusplus
# define fabsf(x) ((float)fabs((double)(float)(x)))
#endif
+ #endif
#endif /* HPUX11_FABSF_CHECK */
Closer inspection shows that this is due to hpux11_fabsf using
bypass = "__cplusplus";
While this is fine for the fix itself, it's quite fragile since (as this
patch shows) it breaks as soon as any math.h test_text happens to
include __cplusplus, which is not that unlikely ;-)
I guess the solution is to use a more specific bypass pattern to make
the fix more robust.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University