From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 072BA3858287; Tue, 2 Apr 2024 16:00:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 072BA3858287 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1712073633; bh=fPkgttLugHRGHjqIUdhx5PuDwOCerOUXQG2ZY0tvhkI=; h=From:To:Subject:Date:From; b=nFjIiQvKDg9HATq0wFqH8ZfXKeP+n2BsUnLcrOgn5LBv60YRtL5TaQxIJIyM3ew7x 0HYZJU2EcTNXFWV2qwNmGTYasamshndOjay1Z5EHBqbeHkOYnChwsPmMOFOYPfPZ6S doLoNwhWZ38eTCf7IkUkTyd/y3yr2M2ETTRO2vsg= 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: 8980516ea10afd7d53303c6520d116742361eb73 X-Git-Newrev: 675e9c3671769a28fb7447d59744f5446349ee78 Message-Id: <20240402160033.072BA3858287@sourceware.org> Date: Tue, 2 Apr 2024 16:00:32 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=675e9c3671769a28fb7447d59744f5446349ee78 commit 675e9c3671769a28fb7447d59744f5446349ee78 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);