public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Iain D Sandoe <iains@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-6159] libgfortran: Fix bootstrap on targets without static_assert macro.
Date: Fri, 31 Dec 2021 13:16:36 +0000 (GMT)	[thread overview]
Message-ID: <20211231131636.716AA3858D37@sourceware.org> (raw)

https://gcc.gnu.org/g:e3cbb8c66c930ba738674b0fcf29848dc3ecfef2

commit r12-6159-ge3cbb8c66c930ba738674b0fcf29848dc3ecfef2
Author: Iain Sandoe <iain@sandoe.co.uk>
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 <iain@sandoe.co.uk>
    
    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;


                 reply	other threads:[~2021-12-31 13:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211231131636.716AA3858D37@sourceware.org \
    --to=iains@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).