From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: Matthias Kretz <m.kretz@gsi.de>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>,
"libstdc++" <libstdc++@gcc.gnu.org>
Subject: Re: [PATCH] libstdc++: Fix for non-constexpr math_errhandling
Date: Wed, 19 Jan 2022 16:47:49 +0000 [thread overview]
Message-ID: <CAH6eHdTdmazxmDbtf4YcTyHTTgDifJjenYGFutxZh9FuXMVTCw@mail.gmail.com> (raw)
In-Reply-To: <CAH6eHdQbidzrN5XEAV+RnFoGJ0O6Ozmnmha+oP9ueda26+16hA@mail.gmail.com>
On Wed, 19 Jan 2022 at 16:45, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
>
> On Wed, 19 Jan 2022 at 15:46, Matthias Kretz <m.kretz@gsi.de> wrote:
> >
> > On Wednesday, 19 January 2022 16:21:15 CET Jonathan Wakely wrote:
> > > On Wed, 19 Jan 2022, 12:45 Matthias Kretz, <m.kretz@gsi.de> wrote:
> > > > On Wednesday, 19 January 2022 13:07:26 CET Jonathan Wakely wrote:
> > > > > So is it a macro or not?
> > > >
> > > > I agree the quote I used is unclear. The complete paragraph:
> > > >
> > > > The macros
> > > >
> > > > MATH_ERRNO
> > > > MATH_ERREXCEPT
> > > >
> > > > expand to the integer constants 1 and 2, respectively; the macro
> > > >
> > > > math_errhandling
> > > >
> > > > expands to an expression that has type int and the value MATH_ERRNO,
> > > > MATH_ERREXCEPT, or the bitwise OR of both. The value of math_errhandling
> > > > is
> > > > constant for the duration of the program. It is unspecified whether
> > > > math_errhandling is a macro or an identifier with external linkage. If a
> > > > macro
> > > > definition is suppressed or a program defines an identifier with the name
> > > > math_errhandling, the behavior is undefined. If the expression
> > > > math_errhandling & MATH_ERREXCEPT can be nonzero, the implementation shall
> > > > define the macros FE_DIVBYZERO, FE_INVALID, and FE_OVERFLOW in
> > > > <fenv.h>.
> > >
> > > But that still says "the macro math_errhandling" and then says it might not
> > > be a macro.
> >
> > There's also [cmath.syn] https://eel.is/c++draft/cmath.syn which says:
> >
> > #define math_errhandling see below
> >
> > So, FWIW, libstdc++ is required to define math_errhandling as a macro in
> > <cmath>. Thus, the original error (that math_errhandling wasn't defined even
> > after <cmath> was included) really needs a fix in <cmath>. :-P
>
> No, because we get it from libc:
>
> #include_next <math.h>
So if you aren't seeing it after <cmath> is included, your libc is broken.
prev parent reply other threads:[~2022-01-19 16:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-19 8:07 Matthias Kretz
2022-01-19 12:07 ` Jonathan Wakely
2022-01-19 12:44 ` Matthias Kretz
2022-01-19 15:21 ` Jonathan Wakely
2022-01-19 15:45 ` Matthias Kretz
2022-01-19 16:45 ` Jonathan Wakely
2022-01-19 16:47 ` Jonathan Wakely [this message]
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=CAH6eHdTdmazxmDbtf4YcTyHTTgDifJjenYGFutxZh9FuXMVTCw@mail.gmail.com \
--to=jwakely.gcc@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=libstdc++@gcc.gnu.org \
--cc=m.kretz@gsi.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).