From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by sourceware.org (Postfix) with ESMTPS id 6FEA73858D32 for ; Mon, 8 May 2023 08:51:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6FEA73858D32 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-ej1-x630.google.com with SMTP id a640c23a62f3a-9659f452148so752586066b.1 for ; Mon, 08 May 2023 01:51:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683535911; x=1686127911; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=p/r+lJTMiCItNNh3eqXTI61I90LizhnthOBIBoeqL/E=; b=oSArErikBsMMJp/BnHyRJrcj/vIP3RoCfAODE+JyxpS6LluUNql/2y0phkuOF3twbw XzA9g8nyzreQexjX3BH8eob1Am1NZXsxGS3u7jfVZ4AaxqhUqRiK5hegZ3G9JWy93PAP AgB0BVh/Oo+woH65gm7NbaKW/9dDN0gB8IEcr7tVodmL7mVt9nW/AtkNn9qNWzO9B7Xy CGd864NDLltmL6vt/X6sdlooigTS48+dsO9OhzJnxjONO0nChBccfjdkI7teqO49bDc1 vT1xN4RVPYCD4XtssWEGWC2NWGiEsacsFEV2Hc52COEAEvB3UH56BuBs6lIWJu05sInj EWBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683535911; x=1686127911; h=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=p/r+lJTMiCItNNh3eqXTI61I90LizhnthOBIBoeqL/E=; b=P0WYCzcOGy9QgwTLrVU5Bpj0lTdF+Jbv+MrUoRav46Z+8rHIQ1y3ZSsIrmocYQzvgt dxXPHBWcCcwNbFNH80kIbWoN+/OyohL8xHZkICxSqAFfqtlN+Scz9uWU1Iw8llriCSzM Fg7HLyUZB+1/D9WRGtgXrXHs3bzpz7qTO6mrzrRKbhDX1t1i8btXtc1x8+Ob8Q4nmCOm lnMpHS/XB04aOlLnHHUJj+QlXE6deLOlldnHan/KSu2RHAvvnkf57pQbirzbKirdXScU MVlr9UJiTzMUTOmNzT9e8h0b76OiK9YM8uzuef8CvKiCdvQ3fLb+P3hmegbEPj6ERpoC RWIA== X-Gm-Message-State: AC+VfDx9S7RtG6ttGNbT/sqJqM2W30oqKRzXOVny6Or0EyHTnutfEzDl Y82LN1Hftg0f0e8bWk7V+HIDR0xnIP2j49xhIqg= X-Google-Smtp-Source: ACHHUZ4Lo+8LxKYW63ux/ig8K1vnfJJt8EcNkgvYoCM/Eeltss/stqTD6ivNbL4oTmExcn31baiwXu50fNvM1ubKMz0= X-Received: by 2002:a17:907:6e8d:b0:961:be96:b0dd with SMTP id sh13-20020a1709076e8d00b00961be96b0ddmr9929422ejc.38.1683535911037; Mon, 08 May 2023 01:51:51 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Mon, 8 May 2023 09:51:40 +0100 Message-ID: Subject: Re: Aw: Re: GCC 13.1 compile error when using CXXFLAGS=-std=c++20 To: NightStrike Cc: Jakub Jelinek , Helmut Zeisel , "gcc@gcc.gnu.org" Content-Type: multipart/alternative; boundary="000000000000f1b0e905fb2abf6f" X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,HTML_MESSAGE,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: --000000000000f1b0e905fb2abf6f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 8 May 2023, 09:38 NightStrike via Gcc, wrote: > 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 wrot= e: > > > >> I compiled GCC 13.1.0 with GCC 12 and had the environment variable > CXXFLAGS 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 > version > > they are written in, or if they are written in common subset, they shou= ld > > 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 > Seems like a reasonable idea at first glance, somebody could test and submit a patch. That pattern will match a hypothetical option like -ffoo-std=3Dbar which is not a -std option. I think a better pattern would be needed. --000000000000f1b0e905fb2abf6f--