diff mbox

Fix libstdc++-v3/include/math.h:66:1 2: error: 'constexpr bool std::isnan(double)' conflicts with a previous declaration

Message ID 20160205010058.GK3471@redhat.com
State New
Headers show

Commit Message

Jonathan Wakely Feb. 5, 2016, 1 a.m. UTC
On 04/02/16 22:41 +0000, Jonathan Wakely wrote:
>On 04/02/16 17:31 -0500, John David Anglin wrote:
>>On 2016-02-04 5:11 PM, Gerald Pfeifer wrote:
>>>In file included from .././../gcc-6-20160131/gcc/genautomata.c:116:0:
>>>/wrkdirs/usr/ports/lang/gcc6-devel/work/gcc-6-20160131/libstdc++-v3/include/c_compatibility/math.h:65:12:
>>>error: 'constexpr bool std::isinf(double)' conflicts with a previous declaration
>>> using std::isinf;
>>>            ^~~~~
>>>
>>>See
>>>http://beefy2.nyi.freebsd.org/data/93amd64-default/408008/logs/gcc6-devel-6.0.0.s20160131.log  
>>>for a full log.
>>The checks for obsolete isinf(double) and isnan(double) are not run 
>>on freebsd.  Apparently,
>>the checks in acinclude.m4 need to be run on freebsd as well.  Maybe 
>>the checks should run almost
>>everywhere?
>
>Yes, maybe. I didn't realise those functions were so widespread, but
>if they are I'm amazed more people weren't yelling about
>https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48891
>
>>The problem wasn't introduced by my change but earlier by Jonathan. 
>>I added hpux to the list
>>of systems with obsolete defines.  The default is to assume there 
>>are no obsolete defines.
>
>I think it should be harmless to run the checks on all systems. If
>they don't have obsolete defines we'll detect that. If they do things
>will start working.

This works on powerpc64-linux (with glibc 2.18 which does define those
functions) and x86_64-freebsd10.2 (which doesn't define them).

Can anyone else test this on an older FreeBSD or other target that
isn't gnu/aix/hpux?

Comments

Gerald Pfeifer Feb. 6, 2016, 12:51 p.m. UTC | #1
On Fri, 5 Feb 2016, Jonathan Wakely wrote:
> Can anyone else test this on an older FreeBSD or other target that
> isn't gnu/aix/hpux?

Thank you, Jonathan!

I did not have such an older environment available, but now
could install the infrastructure and get all prerequisites 
in place for FreeBSD 9.3/AMD64 testing.

That allowed to both reproduce the original failure and confirm
that it does not occur any more with your proposed patch.

Gerald
Jonathan Wakely Feb. 6, 2016, 3:31 p.m. UTC | #2
On 6 February 2016 at 12:51, Gerald Pfeifer <gerald@pfeifer.com> wrote:
> On Fri, 5 Feb 2016, Jonathan Wakely wrote:
>>
>> Can anyone else test this on an older FreeBSD or other target that
>> isn't gnu/aix/hpux?
>
>
> Thank you, Jonathan!
>
> I did not have such an older environment available, but now
> could install the infrastructure and get all prerequisites in place for
> FreeBSD 9.3/AMD64 testing.
>
> That allowed to both reproduce the original failure and confirm
> that it does not occur any more with your proposed patch.

OK, thanks. I'll commit it on Monday (with a slight tweak).
diff mbox

Patch

commit 8be7de1a900b22622b7f4ef3534572dfb1f52892
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Feb 4 23:54:47 2016 +0000

    Enable isinf/isnan checks for all targets
    
    	* acinclude.m4 (GLIBCXX_CHECK_MATH11_PROTO): Enable checks for
    	obsolete isinf and isnan for all targets except *-*-solaris2.*.
    	* configure: Regenerate.

diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index 057b58e..bdcb264 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -2215,7 +2215,7 @@  AC_DEFUN([GLIBCXX_CHECK_MATH11_PROTO], [
       fi
       AC_MSG_RESULT([$glibcxx_cv_math11_overload])
       ;;
-    *-*-*gnu* | *-*-aix* | *-*-hpux*)
+    *)
       # If <math.h> defines the obsolete isinf(double) and isnan(double)
       # functions (instead of or as well as the C99 generic macros) then we
       # can't define std::isinf(double) and std::isnan(double) in <cmath>
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index a919a3e..c3f627f 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -18266,7 +18266,7 @@  fi
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_math11_overload" >&5
 $as_echo "$glibcxx_cv_math11_overload" >&6; }
       ;;
-    *-*-*gnu* | *-*-aix* | *-*-hpux*)
+    *)
       # If <math.h> defines the obsolete isinf(double) and isnan(double)
       # functions (instead of or as well as the C99 generic macros) then we
       # can't define std::isinf(double) and std::isnan(double) in <cmath>