summaryrefslogtreecommitdiffstats
path: root/libgfortran
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2021-12-31 11:52:22 +0000
committerIain Sandoe <iain@sandoe.co.uk>2021-12-31 13:16:16 +0000
commite3cbb8c66c930ba738674b0fcf29848dc3ecfef2 (patch)
tree409935584107142f6f245892baaaea3469152317 /libgfortran
parenttestsuite: XFAIL some Wstringop-overflow tests ... (diff)
downloadgcc-e3cbb8c66c930ba738674b0fcf29848dc3ecfef2.tar.gz
gcc-e3cbb8c66c930ba738674b0fcf29848dc3ecfef2.tar.bz2
gcc-e3cbb8c66c930ba738674b0fcf29848dc3ecfef2.tar.xz
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 <iain@sandoe.co.uk> libgfortran/ChangeLog: * runtime/string.c (gfc_itoa): Use _Static_assert directly instead of via the static_assert macro.
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/runtime/string.c4
1 files 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)
242 integers (we would need three calls), but they do suffice for all 242 integers (we would need three calls), but they do suffice for all
243 values up to 2^127, which is the largest that Fortran can produce 243 values up to 2^127, which is the largest that Fortran can produce
244 (-HUGE(0_16)-1) with its signed integer types. */ 244 (-HUGE(0_16)-1) with its signed integer types. */
245 static_assert(sizeof(GFC_UINTEGER_LARGEST) <= 2 * sizeof(uint64_t), 245 _Static_assert (sizeof(GFC_UINTEGER_LARGEST) <= 2 * sizeof(uint64_t),
246 "integer too large"); 246 "integer too large");
247 247
248 GFC_UINTEGER_LARGEST r; 248 GFC_UINTEGER_LARGEST r;
249 r = n % TEN19; 249 r = n % TEN19;