From: "Howland, Craig D. - US via newlib" <newlib@sourceware.org>
To: "newlib@sourceware.org" <newlib@sourceware.org>
Subject: Re: [PATCH v4 2/3] Add default implementation of fenv.h and all methods
Date: Thu, 08 Aug 2019 04:12:00 -0000 [thread overview]
Message-ID: <1565237528222.64280@caci.com> (raw)
In-Reply-To: <1565194471-21861-1-git-send-email-joel@rtems.org>
I think I have identified all of the individual places where return values should be 0 as Joseph Myers noted in general, as well as some other small items.
Craig
> From: newlib-owner@sourceware.org <newlib-owner@sourceware.org> on behalf of Joel Sherrill <joel@rtems.org>
> Sent: Wednesday, August 7, 2019 12:14 PM
> To: newlib@sourceware.org
> Cc: Joel Sherrill
> Subject: [PATCH v4 2/3] Add default implementation of fenv.h and all methods
>
> The default implementation of the fenv.h methods return
> -EOPNOTSUPP.
[typo:] -ENOTSUP
>
> The intention of the new fenv.h is that it be portable
> and that architectures provide their own implementation
> of sys/fenv.h.
> ---
> ...
> diff --git a/newlib/libm/fenv/feclearexcept.c b/newlib/libm/fenv/feclearexcept.c
> new file mode 100644
> +int feclearexcept(int excepts)
> +{
> + return -ENOTSUP;
return (excepts ? -ENOTSUP : 0);
> ...
> diff --git a/newlib/libm/fenv/fegetround.c b/newlib/libm/fenv/fegetround.c
> ...
> +FUNCTION
> +<<fegetround>>---get current rounding direction
> +
> +INDEX
> + feclearexcept
[typo, not feclearexcept:] fegetround
> +SYNOPSIS
> + #include <fenv.h>
> + int fegetround(void);
> +
> + Link with -lm.
> +
> +DESCRIPTION
> +This method returns the current rounding direction.
> +
> +RETURNS
> +This method returns the rounding direction. If the current rounding
> +direction cannot be determined, then a negative value is returned.
[Small edit, pointing out macro value needed:]
This method returns the rounding direction, corresponding to the value
of the respective rounding macro. If the current rounding
direction cannot be determined, then a negative value is returned.
> ...
> diff --git a/newlib/libm/fenv/feraiseexcept.c b/newlib/libm/fenv/feraiseexcept.c
> ...
> +int feraiseexcept(int excepts)
> +{
> + return -ENOTSUP;
return (excepts ? -ENOTSUP : 0);
> +}
> ...
> diff --git a/newlib/libm/fenv/fesetenv.c b/newlib/libm/fenv/fesetenv.c
> ...
> +SYNOPSIS
> + #include <fenv.h>
> + int fesetenv(const fenv_t *[<envp>]);
> +
> + Link with -lm.
> +
> +DESCRIPTION
> +This method attempts to establish the floating-point environment
> +pointed to by <[envp]>. The argument [<envp>] must point to a
> +floating-point environment obtained via <<fegetenv>> or <<feholdexcept>>
> +or a floating-point environment macro such as <<FE_DFL_ENV>>.
[Add:]
It only sets the states of the flags as recorded in its argument, and
does not actually raise the associated floating-point exceptions.
> ...
> diff --git a/newlib/libm/fenv/fesetround.c b/newlib/libm/fenv/fesetround.c
> ...
> +SYNOPSIS
> + #include <fenv.h>
> + int fesetround(int <[round]>);
> +
> + Link with -lm.
> +
> +DESCRIPTION
> +This method attempts to set the current rounding direction represented
> +by <[round]>.
[Add:]
<[round]> must be the value of one of the rounding-direction macros.
> ...
> diff --git a/newlib/libm/fenv/fetestexcept.c b/newlib/libm/fenv/fetestexcept.c
> ...
> +int fetestexcept(int excepts)
> +{
> + return -ENOTSUP;
return 0;
> ...
next prev parent reply other threads:[~2019-08-08 4:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-07 16:14 Joel Sherrill
2019-08-07 16:36 ` Joseph Myers
2019-08-07 16:49 ` Joel Sherrill
2019-08-08 4:12 ` Howland, Craig D. - US via newlib [this message]
2019-08-08 15:12 ` Joel Sherrill
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=1565237528222.64280@caci.com \
--to=newlib@sourceware.org \
--cc=craig.howland@caci.com \
/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).