public inbox for glibc-cvs@sourceware.org help / color / mirror / Atom feed
From: Adhemerval Zanella <azanella@sourceware.org> To: glibc-cvs@sourceware.org Subject: [glibc/azanella/clang] math: Remove _Static_assert that uses EXCEPTION_SET_FORCES_TRAP Date: Wed, 17 Apr 2024 20:14:22 +0000 (GMT) [thread overview] Message-ID: <20240417201422.715C93858CD1@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1b803c315f36042a3e6191692eca40800210aa16 commit 1b803c315f36042a3e6191692eca40800210aa16 Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Thu Jan 4 10:29:09 2024 -0300 math: Remove _Static_assert that uses EXCEPTION_SET_FORCES_TRAP And make them a runtime check with assert since EXCEPTION_SET_FORCES_TRAP might not be an integral constant expression (i.e on i386). Diff: --- math/test-fesetexcept-traps.c | 10 +++++++--- math/test-fexcept-traps.c | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/math/test-fesetexcept-traps.c b/math/test-fesetexcept-traps.c index 73f542027e..3aff7073e4 100644 --- a/math/test-fesetexcept-traps.c +++ b/math/test-fesetexcept-traps.c @@ -46,9 +46,13 @@ do_test (void) Also check if the function does not alter the exception mask. */ ret = fesetexcept (FE_ALL_EXCEPT); - _Static_assert (!(EXCEPTION_SET_FORCES_TRAP && !EXCEPTION_TESTS(float)), - "EXCEPTION_SET_FORCES_TRAP only makes sense if the " - "architecture suports exceptions"); + if (EXCEPTION_SET_FORCES_TRAP && !EXCEPTION_TESTS(float)) + { + puts ("EXCEPTION_SET_FORCES_TRAP only makes sense if the architecture " + "suports exceptions"); + return 77; + } + { int exc_before = fegetexcept (); ret = fesetexcept (FE_ALL_EXCEPT); diff --git a/math/test-fexcept-traps.c b/math/test-fexcept-traps.c index 0f5802c773..83053b074d 100644 --- a/math/test-fexcept-traps.c +++ b/math/test-fexcept-traps.c @@ -70,9 +70,13 @@ do_test (void) Also check if the function does not alter the exception mask. */ ret = fesetexceptflag (&saved, FE_ALL_EXCEPT); - _Static_assert (!(EXCEPTION_SET_FORCES_TRAP && !EXCEPTION_TESTS(float)), - "EXCEPTION_SET_FORCES_TRAP only makes sense if the " - "architecture suports exceptions"); + if (EXCEPTION_SET_FORCES_TRAP && !EXCEPTION_TESTS(float)) + { + puts ("EXCEPTION_SET_FORCES_TRAP only makes sense if the architecture " + "suports exceptions"); + return 77; + } + { int exc_before = fegetexcept (); ret = fesetexceptflag (&saved, FE_ALL_EXCEPT);
next reply other threads:[~2024-04-17 20:14 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-04-17 20:14 Adhemerval Zanella [this message] -- strict thread matches above, loose matches on Subject: below -- 2024-04-02 16:00 Adhemerval Zanella 2024-02-09 17:38 Adhemerval Zanella 2024-02-07 14:14 Adhemerval Zanella 2024-01-29 18:04 Adhemerval Zanella
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=20240417201422.715C93858CD1@sourceware.org \ --to=azanella@sourceware.org \ --cc=glibc-cvs@sourceware.org \ /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: linkBe 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).