generic fenv wrapup

Joel Sherrill <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <CAF9ehCV+J3u4WoaXH9hUXK2KXrXXq7DMD0aszv34Az=vgNLOhg@mail.gmail.com>
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?

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

--joel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.