From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 0837C3858297; Wed, 7 Feb 2024 14:14:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0837C3858297 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1707315250; bh=iBeZ8D/ZIOrpljp7Z4N9LkOTx5tBntNUuerW06UjYbk=; h=From:To:Subject:Date:From; b=oLkvcqGvKzMLkVC6VPdlObQB7/ixdmYyovhMLjjm1hn0G9i+Axu8ae6g81qK9lVZy TXXr8p2LoERdUwPGWVj2bKaCVZTzRgEtzIyvggmFn/zfM212l9H4BtnYCbeN2IhC+p FdcFbAoCIz4c74U11uU1GjRKzOZZaOR+i2zPHLuw= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/azanella/clang] math: Remove _Static_assert that uses EXCEPTION_SET_FORCES_TRAP X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/azanella/clang X-Git-Oldrev: 11b3464b2dbf8f9421db5a874297754388edfe6b X-Git-Newrev: 0ac4c5dce2179d78280354bb6d921030e158bc46 Message-Id: <20240207141410.0837C3858297@sourceware.org> Date: Wed, 7 Feb 2024 14:14:10 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=0ac4c5dce2179d78280354bb6d921030e158bc46 commit 0ac4c5dce2179d78280354bb6d921030e158bc46 Author: Adhemerval Zanella 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);