[PATCH v3 2/3] Add default implementation of fenv.h and all methods
Corinna Vinschen
vinschen@redhat.com
Wed Aug 7 08:36:00 GMT 2019
Hi Joel,
On Aug 6 14:13, Joel Sherrill wrote:
> [...]
> +//#define FE_DIVBYZERO 0x00000001
> +//#define FE_INEXACT 0x00000002
> +//#define FE_INVALID 0x00000004
> +//#define FE_OVERFLOW 0x00000008
> +//#define FE_UNDERFLOW 0x00000010
> +
> +//#define FE_ALL_EXCEPT \
> + //(FE_DIVBYZERO|FE_INEXACT|FE_INVALID|FE_OVERFLOW|FE_UNDERFLOW)
> +#define FE_ALL_EXCEPT 0 /* NONE SUPPORTED IN PLACEHOLDER TEMPLATE */
> +
> +/*
> + * The following macros are to be defined if the respective rounding
> + * direction is supported by the implementation via the fegetround() and
> + * fesetround() functions, each with a unique positive value.
> + *
> + * FE_DOWNWARD
> + * FE_TONEAREST
> + * FE_TOWARDZERO
> + * FE_UPWARD
> + *
> + * Other implementation-specific rounding modes may be defined, and must start
> + * with FE_ followed by a capital letter.
> + */
> +//#define FE_DOWNWARD 1
> +//#define FE_TONEAREST 2
> +//#define FE_TOWARDZERO 3
> +//#define FE_UPWARD 4
> +
> +/*
> + * The following typedefs are required. See the C and POSIX standards for
> + * details:
> + *
> + * fenv_t
> + * fexcept_t
> + */
> +typedef size_t fenv_t;
> +typedef size_t fexcept_t;
While these types are defined, the above macros are not. Wouldn't
it make sense to define all or nothing by default?
Additionally, the default type here should better be one of the
predefined types like 'int' or 'unsigned int'. The target has to
overwrite them anyway. Using a derived type like size_t could puzzle
the developer into thinking there are minimum size requirements.
The rest looks ok to me.
Thanks,
Corinna
--
Corinna Vinschen
Cygwin Maintainer
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20190807/47dfb028/attachment.sig>
More information about the Newlib
mailing list