This is the mail archive of the
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>, James Dennett <james dot dennett at gmail dot com>
- Date: Fri, 8 Jan 2016 19:22:00 +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> <CAH6eHdSJNOXkH2=UpMUUOUHUCpdmvZT_DFdAhG0NBV3kKCzLqg at mail dot gmail dot com> <CAH6eHdTzV+OKzkU_V13REitGor5U1w9pxQSadv=s+RSR7ySxiQ at mail dot gmail dot com>
On 7 January 2016 at 13:36, Jonathan Wakely wrote:
> On 7 January 2016 at 13:14, Jonathan Wakely wrote:
>> 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
> Oops, typo, I meant PR48891.
>> 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.
It took a bit longer than I expected, but there's a patch for
C++-conforming <math.h> and <stdlib.h> wrappers at
which relies on the fix for the std::isinf and std::isnan bug at
with an accompanying glibc bug report at
Phew, time for the weekend.