public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org
Subject: Re: [v3] Handle C++11 <math.h> overloads on Solaris 12
Date: Tue, 24 Nov 2015 12:43:00 -0000	[thread overview]
Message-ID: <20151124123532.GJ11200@redhat.com> (raw)
In-Reply-To: <yddwpt7bmsb.fsf@lokon.CeBiTec.Uni-Bielefeld.DE>

On 24/11/15 13:32 +0100, Rainer Orth wrote:
>Jonathan Wakely <jwakely@redhat.com> writes:
>
>> On 17/11/15 13:33 +0100, Rainer Orth wrote:
>>>Solaris 12 recently introduced the C++11 <math.h> overloads, which
>>>caused bootstrap to be broken on both mainline and the gcc-5 branch:
>>>
>>>In file included from /vol/gcc/src/hg/trunk/local/libstdc++-v3/include/precompiled/stdc++.h:41:0:
>>>/var/gcc/regression/trunk/12-gcc/build/i386-pc-solaris2.12/libstdc++-v3/include/cmath: In function 'constexpr int std::fpclassify(float)':
>>>/var/gcc/regression/trunk/12-gcc/build/i386-pc-solaris2.12/libstdc++-v3/include/cmath:561:3: error: redefinition of 'constexpr int std::fpclassify(float)'
>>>   fpclassify(float __x)
>>>   ^
>>>In file included from /usr/include/math.h:13:0,
>>>                 from /var/gcc/regression/trunk/12-gcc/build/i386-pc-solaris2.12/libstdc++-v3/include/cmath:44,
>>>                 from /vol/gcc/src/hg/trunk/local/libstdc++-v3/include/precompiled/stdc++.h:41:
>>>/usr/include/iso/math_c99.h:647:13: note: 'int std::fpclassify(float)' previously defined here
>>>  inline int fpclassify(float __X) { return __builtin_fpclassify(
>>>             ^
>>>
>>>The following patch fixes this by testing for the problem and wrapping
>>>the overloads in include/c_global/cmath and include/tr1/cmath
>>>appropriately.  The test needs to be dynamic since apparently a backport
>>>to Solaris 11 (and perhaps even Solaris 10) is planned.
>>
>> Why does <tr1/cmath> need to change, did Solaris also define the
>> functions in namespace std::tr1?
>
>Without that part, I get errors like
>
>In file included from /vol/gcc/src/hg/trunk/local/libstdc++-v3/include/precompiled/stdtr1c++.h:37:0:
>/var/gcc/regression/trunk/12-gcc/build/i386-pc-solaris2.12/libstdc++-v3/include/tr1/cmath: In function 'float std::tr1::acosh(float)':
>/var/gcc/regression/trunk/12-gcc/build/i386-pc-solaris2.12/libstdc++-v3/include/tr1/cmath:423:18: error: 'float std::tr1::acosh(float)' conflicts with a previous declaration
>   acosh(float __x)

Ah yes, because there's a using std::acosh, which puts Solaris' new
overloads into namespace std::tr1.

OK, that's correct then, and the patch is OK for trunk and
gcc-5-branch as far as I'm concerned.

  reply	other threads:[~2015-11-24 12:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-17 12:33 Rainer Orth
2015-11-24 12:07 ` Jonathan Wakely
2015-11-24 12:33   ` Rainer Orth
2015-11-24 12:43     ` Jonathan Wakely [this message]
2015-11-24 12:45       ` Jonathan Wakely
2015-11-24 13:33       ` Rainer Orth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151124123532.GJ11200@redhat.com \
    --to=jwakely@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    --cc=ro@CeBiTec.Uni-Bielefeld.DE \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).