This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Strange C++ function pointer test
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>, Dominik Vogt <vogt at linux dot vnet dot ibm dot com>, Andreas Krebbel <krebbel at linux dot vnet dot ibm dot com>
- Date: Thu, 7 Jan 2016 13:14:37 +0000
- Subject: Re: Strange C++ function pointer test
- Authentication-results: sourceware.org; auth=none
- References: <20151231094918 dot GA12885 at linux dot vnet dot ibm dot com> <alpine dot DEB dot 2 dot 20 dot 1512311055290 dot 17945 at laptop-mg dot saclay dot inria dot fr> <CAH6eHdTASETHDhGYdC60iOw1PgmtUOhwVT_iJ4Fi4ZCYCzomyg at mail dot gmail dot com> <alpine dot DEB dot 2 dot 20 dot 1512311226480 dot 23439 at laptop-mg dot saclay dot inria dot fr> <CAH6eHdSr1qR9qMUwcfb6W54n4v2N9q9PwXVB31eWbdzE5__+XA at mail dot gmail dot com> <568A3C37 dot 5090400 at redhat dot com> <CAH6eHdQVowvsDE-72zVNe7_c23QEkAoUPR-oCJzxpFND7VDSPQ at mail dot gmail dot com>
On 6 January 2016 at 21:05, Jonathan Wakely wrote:
> I have been meaning to try solving it in libstdc++ with a new <math.h>
> that includes the libc one and extends it, to see how well that works.
> I haven't had time to try that, so it would be premature to ask for
> changes to be made to glibc when I don't know if they are necessary or
> would even be the best solution.
I have a working patch (to be posted later today) which fixes this
issue, and LWG 2294.
However, because my patch means that <math.h> always includes <cmath>
it makes it much easier to hit PR48892 (aka PR60407 aka PR68984). I
have a workaround for that, which is fragile and ugly. A better
solution would be for glibc's mathcalls.h to suppress the non-generic
Unix98 isnan and isinf functions when included from C++, as Joseph
suggested at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54130#c14
Libstdc++ can #undef isinf and #undef isnan to remove the C99 macros,
but it can't undefine functions, we'd need to use fixincludes for
that. Maybe it's time to address the isinf/isnan issue properly.