public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: "Howland, Craig D. - US via newlib" <newlib@sourceware.org>
To: "newlib@sourceware.org" <newlib@sourceware.org>
Subject: Re: [PATCH 2/3] libc/include/sys/fenv.h: Add glibc extension of FE_NOMASK_ENV.
Date: Wed, 28 Aug 2019 23:40:00 -0000	[thread overview]
Message-ID: <1567035615197.22910@caci.com> (raw)
In-Reply-To: <1567004819-5473-3-git-send-email-joel@rtems.org>

________________________________________
> From: newlib-owner@sourceware.org <newlib-owner@sourceware.org> on behalf of joel@rtems.org <joel@rtems.org>
> Sent: Wednesday, August 28, 2019 11:06 AM
> To: newlib@sourceware.org
> Cc: Joel Sherrill
> Subject: [PATCH 2/3] libc/include/sys/fenv.h: Add glibc extension of FE_NOMASK_ENV.
>
> From: Joel Sherrill <joel@rtems.org>
>
> ---
>  newlib/libc/include/sys/fenv.h | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/newlib/libc/include/sys/fenv.h b/newlib/libc/include/sys/fenv.h
> index e0983fa..d2c1302 100644
> --- a/newlib/libc/include/sys/fenv.h
> +++ b/newlib/libc/include/sys/fenv.h
> @@ -110,4 +110,13 @@ typedef int fexcept_t;
>  extern const fenv_t *_fe_dfl_env;
>  #define FE_DFL_ENV _fe_dfl_env
>
> +#if __GNU_VISIBLE
> +/*  If possible, the GNU C Library defines a macro FE_NOMASK_ENV which
> +   represents an environment where every exception raised causes a trap
> +   to occur. You can test for this macro using #ifdef. It is only defined
> +   if _GNU_SOURCE is defined.  */
> +extern const fenv_t *_fe_nomask_env;
> +#define FE_NOMASK_ENV (_fe_nomask_env)
> +#endif /* __GNU_VISIBLE */
> +
>  #endif /* _SYS_FENV_H_ */
> --
> 1.8.3.1
--------------------------------------------------------------------------------
It says define it when possible.  But this is unconditional in terms of 
whether an implementation can do so or not.  (It is conditional on the
__GNU_VISIBLE option, but that's a compilation choice for GNU_SOURCE.)
There needs to be a way to know if traps are possible are not.  This
seems more appropriate to be undefined by default, as many embedded
applications don't even have the concept of traps.
Craig

  reply	other threads:[~2019-08-28 23:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-28 15:07 [PATCH 0/3] fenv support round 2 joel
2019-08-28 15:07 ` [PATCH 2/3] libc/include/sys/fenv.h: Add glibc extension of FE_NOMASK_ENV joel
2019-08-28 23:40   ` Howland, Craig D. - US via newlib [this message]
2019-08-28 15:07 ` [PATCH 1/3] riscv/include/fenv.h: Use shared fenv.h joel
2019-08-29 11:50   ` Kito Cheng
2019-08-28 15:07 ` [PATCH 3/3] Add i386 and x86_64 fenv support from Cygwin joel
2019-08-28 15:41   ` Corinna Vinschen
2019-08-28 16:57     ` Joel Sherrill
2019-08-29  8:03       ` Corinna Vinschen
2019-08-28 15:27 ` [PATCH 0/3] fenv support round 2 Corinna Vinschen
2019-08-28 15:45   ` Joel Sherrill
2019-08-28 15:51     ` Corinna Vinschen

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=1567035615197.22910@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).