From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x31.google.com (mail-oa1-x31.google.com [IPv6:2001:4860:4864:20::31]) by sourceware.org (Postfix) with ESMTPS id BCD9F3858D32 for ; Mon, 8 May 2023 08:38:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BCD9F3858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oa1-x31.google.com with SMTP id 586e51a60fabf-19615d6ef9eso303004fac.0 for ; Mon, 08 May 2023 01:38:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683535099; x=1686127099; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=vN9s5hdoz9tKLX2IqYXZK9w5Ox6k2IamuOvJR/yfI5Q=; b=be1MPpYbAvi1/EKOLhJhAJLmzIwa5Y5984M9+Hi6jQ1M7Oi8JxcvDPh4TAi4r8Jcsc DXr6gzMh+Vn9W7ZMB86wsrm+J+MUX6/IDyo5GdF7xfIGQ58bzxGucgw1vRNjb6mZ+ETy ZCaZ8UQ0kgW5zNNzPKX47mrjjFKcw8o3oVirZxjjkSOEJ+p7Jm0DLeZS2OWFdkMYxVuE U3Pp2t/wdqTMKTZZiVdI46MjaaSCsX+bQ8r39V9rqV+KCyfuO2fxHIhCm2EhLWlkbuB3 6aiidJ33oGbdi7vxpAdI8JR1pE07Ks+oVWMoJKTa9XvX29pBNScglUggyI1pFZhmubkL Sy4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683535099; x=1686127099; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vN9s5hdoz9tKLX2IqYXZK9w5Ox6k2IamuOvJR/yfI5Q=; b=AEZqz7vs9vguF8Tz1ZQf28V3c85WelYGHE66eiMA1NLJS40qArvKmMV/CIBqW5Qjx0 ZYa/3+hm9wwNoGoxN1iPW+pKBylaja1F1VBoI2D0tPidbKjyk731ErQzN7dx/3jQ+55u noFtcbBdmAH0cJhLE5Db4XuZ2MBSpl9gLR956bjJUR+Gial2p6YJrXqA/C23skxvN6yf JMn6m5FQfJrcpaQBU8Be1riZ+Ig7dbB5RctQoOedh810F4Zqn/NJEPU/D56VAwIYxP7L ozBzZ7mO2snhh5R8BYCHy1WEbt578GPym/CoiE522mYOZizmGFuUMDOyEO5sxLvvpd8x lovA== X-Gm-Message-State: AC+VfDymMZ1oGwJOkHYZlfez4YJM1cWbBWQaiMoRvk6G2NIdGTATII8Y 9uiP8Pa4FppEmuO2eJpJXbQTcO6Spo/p+Jpf5gg= X-Google-Smtp-Source: ACHHUZ4rS2NPUeocyO1lFmhGt5Au0ZeiGG+SXm/4vPb8LU53p0xZs/01Liv79bTC1XSAJ1Zdr0jtKFxPTnOx9Geu9E0= X-Received: by 2002:a05:6808:b15:b0:389:92d6:18a1 with SMTP id s21-20020a0568080b1500b0038992d618a1mr4761310oij.24.1683535098810; Mon, 08 May 2023 01:38:18 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: NightStrike Date: Mon, 8 May 2023 04:38:08 -0400 Message-ID: Subject: Re: Aw: Re: GCC 13.1 compile error when using CXXFLAGS=-std=c++20 To: Jakub Jelinek Cc: Helmut Zeisel , gcc@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Thu, Apr 27, 2023 at 5:41=E2=80=AFAM Jakub Jelinek via Gcc wrote: > > On Thu, Apr 27, 2023 at 11:35:23AM +0200, Helmut Zeisel wrote: > > >Von: "Jakub Jelinek" > > >An: "Helmut Zeisel" > > >Cc: gcc@gcc.gnu.org > > >Betreff: Re: GCC 13.1 compile error when using CXXFLAGS=3D-std=3Dc++20 > > >On Thu, Apr 27, 2023 at 11:09:19AM +0200, Helmut Zeisel via Gcc wrote: > > >> I compiled GCC 13.1.0 with GCC 12 and had the environment variable C= XXFLAGS set to -std=3Dc++20 > > >> This gives the error (both linux and cygin) > > >> > > >> gcc-13.1.0/libstdc++-v3/src/c++98/bitmap_allocator.cc:51:23: error: = ISO C++17 does not allow dynamic exception specifications > > >> 51 | _M_get(size_t __sz) throw(std::bad_alloc) > > >> > > >> After > > >> > > >> unset CXXFLAGS > > >> > > >> compilation works > > > > >Don't do it. > > > > Dont do *what*? > > export CXXFLAGS=3D... ? > > Include explicit -std=3D settings in such exported variables, especially = when > building GCC. Packages should decide themselves in which language versio= n > they are written in, or if they are written in common subset, they should > just defer to the compiler default. > Note, doing that would break building even much older GCC versions. Maybe configure should catch that? diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac index 0dd550a4b4b..f0d998aad94 100644 --- a/libstdc++-v3/configure.ac +++ b/libstdc++-v3/configure.ac @@ -86,6 +86,9 @@ AH_TEMPLATE(VERSION, [Version number of package]) # -fno-builtin must be present here so that a non-conflicting form of # std::exit can be guessed by AC_PROG_CXX, and used in later tests. +AS_CASE(["$CXXFLAGS"], + [*-std=3D*], [AC_MSG_ERROR([don't do that])]) + save_CXXFLAGS=3D"$CXXFLAGS" CXXFLAGS=3D"$CXXFLAGS -fno-builtin" AC_PROG_CC