public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Corinna Vinschen <vinschen@redhat.com>
To: newlib@sourceware.org
Subject: Re: generic fenv wrapup
Date: Tue, 13 Aug 2019 07:50:00 -0000	[thread overview]
Message-ID: <20190813075032.GR11632@calimero.vinschen.de> (raw)
In-Reply-To: <CAF9ehCV+J3u4WoaXH9hUXK2KXrXXq7DMD0aszv34Az=vgNLOhg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1867 bytes --]

On Aug 12 08:51, Joel Sherrill wrote:
> Hi
> 
> We discussed a lot for this patch. I see FE_NOMASK_ENV isn't included.
> When looking at that, the comment in /usr/include/bits/fenv.h on CentOS 7
> has a subject verb agreement issue that leads me to question its intent.
>  I would like someone to confirm that the glibc manual and this comment
> mean the same thing:
> 
> ifd#f __USE_GNU
> /* Floating-point environment where none of the exception is masked.  */
> # define FE_NOMASK_ENV  ((const fenv_t *) -2)
> #endif
> 
> And from the manual:
> 
>     If possible, the GNU C Library defines a macro FE_NOMASK_ENV which rep‐
>        resents  an  environment  where every exception raised causes a trap
> to
>        occur.  You can test for this macro using #ifdef.  It is  defined
>  only
>        if  _GNU_SOURCE  is defined.
> 
> I think the manual version is clearer on intent.
> 
> Also.. there are three other GNU specific methods:
> 
>       #define _GNU_SOURCE         /* See feature_test_macros(7) */
>        #include <fenv.h>
> 
>        int feenableexcept(int excepts);
>        int fedisableexcept(int excepts);
>        int fegetexcept(void);
> 
> Should all those be added conditionally?

_GNU_SOURCE definitely.  Conditionally on what else?  

> What else did we think needed to be done with the fenv generic code before
> moving on to focusing on implementations?

Just have a look into Cygwin's fenv.h.  There's also fegetprec/fesetprec
which have been defined with SunOS and made it into a standarization
proposal http://www.open-std.org/jtc1/sc22//WG14/www/docs/n752.htm They
have not been standarized, though, so this is kind of optional.  They
should probably get defined for x86{_64} but not necessarily for any
other target.


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      reply	other threads:[~2019-08-13  7:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-12 13:51 Joel Sherrill
2019-08-13  7:50 ` Corinna Vinschen [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=20190813075032.GR11632@calimero.vinschen.de \
    --to=vinschen@redhat.com \
    --cc=newlib@sourceware.org \
    /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).