From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by sourceware.org (Postfix) with ESMTPS id D1AAC3858D37; Fri, 31 Dec 2021 13:20:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D1AAC3858D37 Received: by mail-wm1-x32b.google.com with SMTP id n10-20020a7bc5ca000000b00345c520d38eso14719642wmk.1; Fri, 31 Dec 2021 05:20:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :mime-version:content-transfer-encoding; bh=e6fPPDCHmZNqzaH3qrFIYjE7s/hjahaAb9UpqjaySx4=; b=s70NNPqaHUqJcMg3/SUjb05F6L/5hYV7aSVGSvAoSiC8+ZSjOFC0FvyB66EqLyN3um jfe+ybtkf09TtRLyPEM1azN0m+knkRRXTFCLi6wWlpnHZqzS6D8gmEypWxP7qIZe+f0M 0txxwvUN2oa9cDCFriXHNWYn7LfQ24KPzf9aL7sEC3aQZycL7LwtQoL7R3C1WCd0IZVr oogyXPRxf3/8eIWhejpzIbQwzMxYzncW2KZCcC/EZlbEhWHtrXOERTFUt9GMih9qeBKv oj6J9AjDZtWQjXkHSoYflg8b8BSiwJ9U7W3qMeuY6RwFROlVqnLF1Tta9+Qm85c/p/NT 28og== X-Gm-Message-State: AOAM530BMywZ1v5ZbeWTJUl+2MXD/epLPB96pnbfPJLl/jt59eLZeWOh 4Co0ApJLvT7HokyunpU+h++ToOlvPB8= X-Google-Smtp-Source: ABdhPJzpOCz8nrmEa7FI2oxaPkHv+8BZKJ2sXdOwOIrd6hn03jpGvMp0W2SWfymTZXYFiLpcbgUWWA== X-Received: by 2002:a05:600c:3546:: with SMTP id i6mr30690833wmq.88.1640956813511; Fri, 31 Dec 2021 05:20:13 -0800 (PST) Received: from localhost.localdomain (host81-138-1-83.in-addr.btopenworld.com. [81.138.1.83]) by smtp.gmail.com with ESMTPSA id k10sm7753894wrz.113.2021.12.31.05.20.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Dec 2021 05:20:13 -0800 (PST) From: Iain Sandoe X-Google-Original-From: Iain Sandoe To: fortran@gcc.gnu.org, gcc-patches@gcc.gnu.org Cc: fxcoudert@gmail.com Subject: [pushed] libgfortran: Fix bootstrap on targets without static_assert macro. Date: Fri, 31 Dec 2021 13:20:06 +0000 Message-Id: <20211231132006.67978-1-iain@sandoe.co.uk> X-Mailer: git-send-email 2.24.3 (Apple Git-128) Reply-To: iain@sandoe.co.uk MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: fortran@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Fortran mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Dec 2021 13:20:17 -0000 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 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)