From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1698) id 716AA3858D37; Fri, 31 Dec 2021 13:16:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 716AA3858D37 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Iain D Sandoe To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-6159] libgfortran: Fix bootstrap on targets without static_assert macro. X-Act-Checkin: gcc X-Git-Author: Iain Sandoe X-Git-Refname: refs/heads/master X-Git-Oldrev: d9da496a82c0ba33098d622efba34f4750c4ccb9 X-Git-Newrev: e3cbb8c66c930ba738674b0fcf29848dc3ecfef2 Message-Id: <20211231131636.716AA3858D37@sourceware.org> Date: Fri, 31 Dec 2021 13:16:36 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Dec 2021 13:16:36 -0000 https://gcc.gnu.org/g:e3cbb8c66c930ba738674b0fcf29848dc3ecfef2 commit r12-6159-ge3cbb8c66c930ba738674b0fcf29848dc3ecfef2 Author: Iain Sandoe Date: Fri Dec 31 11:52:22 2021 +0000 libgfortran: Fix bootstrap on targets without static_assert macro. Although we build the library with GCC which is known to support _Static_assert this might be done on a system without the macro mapping static_assert to the compiler keyword. The use of static_assert introduced with r12-6126-g3430132f3e82 causes bootstrap to fail on such targets, fixed by using the keyword directly. Signed-off-by: Iain Sandoe libgfortran/ChangeLog: * runtime/string.c (gfc_itoa): Use _Static_assert directly instead of via the static_assert macro. Diff: --- libgfortran/runtime/string.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libgfortran/runtime/string.c b/libgfortran/runtime/string.c index 21585f48dc9..5bc202320c0 100644 --- a/libgfortran/runtime/string.c +++ b/libgfortran/runtime/string.c @@ -242,8 +242,8 @@ gfc_itoa (GFC_UINTEGER_LARGEST n, char *buffer, size_t len) integers (we would need three calls), but they do suffice for all values up to 2^127, which is the largest that Fortran can produce (-HUGE(0_16)-1) with its signed integer types. */ - static_assert(sizeof(GFC_UINTEGER_LARGEST) <= 2 * sizeof(uint64_t), - "integer too large"); + _Static_assert (sizeof(GFC_UINTEGER_LARGEST) <= 2 * sizeof(uint64_t), + "integer too large"); GFC_UINTEGER_LARGEST r; r = n % TEN19;