public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
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 15:21:15 +0000	[thread overview]
Message-ID: <CAH6eHdTtdVpZNkT3KoJW1VVs1Ohs7ZummEOwwvR9JdjYR5EatA@mail.gmail.com> (raw)
In-Reply-To: <8881104.CDJkKcVGEf@minbar>

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:
> > On Wed, 19 Jan 2022 at 08:10, Matthias Kretz wrote:
> > > Follow-up to my last patch. This one is a more thorough fix. Tested on
> > > x86_64-
> > > linux. OK for trunk?
> > >
> > > ---- 8< ----
> > >
> > > Use SFINAE magic to support: "It is unspecified whether
> math_errhandling
> > > is a macro or an identifier with external linkage." [C Standard]
> >
> > The patch is OK for trunk, but I don't understand what the C standard
> means
> > here.
> >
> > "the macro math_errhandling expands to [...]. It is unspecified whether
> > math_errhandling is a macro or an identifier with external linkage."
> >
> > 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.

I'll ask some WG14 people for clarity, but it doesn't affect your patch.

  reply	other threads:[~2022-01-19 15:21 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 [this message]
2022-01-19 15:45       ` Matthias Kretz
2022-01-19 16:45         ` Jonathan Wakely
2022-01-19 16:47           ` Jonathan Wakely

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=CAH6eHdTtdVpZNkT3KoJW1VVs1Ohs7ZummEOwwvR9JdjYR5EatA@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).