* [pushed] libgfortran: Fix bootstrap on targets without static_assert macro.
@ 2021-12-31 13:20 Iain Sandoe
0 siblings, 0 replies; only message in thread
From: Iain Sandoe @ 2021-12-31 13:20 UTC (permalink / raw)
To: fortran, gcc-patches; +Cc: fxcoudert
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.
tested on i686-darwin9 and x86_64-darwin18, without regressions,
pushed to master as an obvious bootstrap fix (and as approved by FX).
thanks
Iain
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.
---
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;
--
2.24.3 (Apple Git-128)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-12-31 13:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-31 13:20 [pushed] libgfortran: Fix bootstrap on targets without static_assert macro Iain Sandoe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).