Re: generic fenv wrapup

Corinna Vinschen <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
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
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAl1Sa8gACgkQ9TYGna5E
T6C8Ig//emtTyZGiDEj8m5Q3ZULgC+j56CVLqBsQdv2/RloXnyUbxyvhZYKqdmrT
lrnjvBiDeVUii/bDRcd0JYrL+AJLxvQxWwTkGJOSJuTvH1OMwwmqnpO/An0Kv3uH
9TETmfLt2QdsPfNh00B1sxiKJHAwYKWp5ulbBDc0YQpFEbMap0IVbZ9gxmtGxpyw
qgJV9ustU6uBFdNUA3D5qfO4YNOrxX52K3u61BeqE/HghMn+t5LrOhD3tOJFyMOn
KkmbFhDg6YiBNlN8s1j3sLOnE9DTyZUJnE4j7lHFATg7ywM713VSdjO/eYHUmpJG
VZM/3rcYPoq8SD1/6EMHOWCKS9q6bUh1lYWh/CLmPxi/O4qjzAm8Ni5uPKq8jgDA
JJapyZc5IGYYgLpIBdkd9FCDRSCkr5Ien1xpYeCJSYe/DrSnEAnJhoWexb7s70fu
jBenHvxAM45QW9aAzhr6Ko8QGoYIZ5BX1NpH0Y2kAtfii+2/hszZwlofsyks8n49
IsSKqR8MwDdC87HKbTgGzM87lOlbqNw/3odwWYY3V5/2LIcYeOpeoemN7MUfRI4M
MOosqYEtdWW2QT+GkQ3JQqf7iqDsGCFU1ZL8gxSRSFmlK8i6uUIYRUTQjt5B/IdP
/j9YackH5ocVpIJtS83X8kcq7D1ljaZzzu798EontV8w3Atmgrc=
=XQYX
-----END PGP SIGNATURE-----
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.