From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 07B243858417; Fri, 9 Feb 2024 17:38:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 07B243858417 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1707500337; bh=mRSJzF4BY2/2EyUlxfQgtLdyTPNJ5NCKduGLDtsIT0Q=; h=From:To:Subject:Date:From; b=VC1rgcPFbMV49vHMbW2kRp6IKuXVimFVJhu1zsDAqiA3KHrdA02n4aQDKWTrCnSo2 tHj9gIH4CDydvcFrPSq5pRiy+rOxsRWWJGXybgX3TGeNaNTK4UuBipTPgrkbmHk62v jlq7Q8T3tZZMAQi7rxScakkTw7qmzVB+Eg+QOUzs= 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: 6370ff5783a00ab737c4050d2f3aa779e9ec06e7 X-Git-Newrev: f7d4a6676aaf39e53a1b7d12740806b68156f784 Message-Id: <20240209173857.07B243858417@sourceware.org> Date: Fri, 9 Feb 2024 17:38:56 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f7d4a6676aaf39e53a1b7d12740806b68156f784 commit f7d4a6676aaf39e53a1b7d12740806b68156f784 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);