From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id 4BD063858D32; Thu, 1 Dec 2022 11:05:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4BD063858D32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.96,209,1665475200"; d="scan'208";a="91367964" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa1.mentor.iphmx.com with ESMTP; 01 Dec 2022 03:05:48 -0800 IronPort-SDR: wb/D9Xs8RdvQdhYiiQPM/Qx35ZhxNWevcceaIdwI3Qa8a2EKrLYPC0xSaooVoSlRXeFvy0h3yO WEfOvC7YKy+az+vZlb+XLDzS/gH0pdwnaZBI892TTAH30MoPlHfJct3t8CXFRmh5d9Dz26WnVU DLQ02I4yXQS8HnBJ5C+EjPm4pSGx7x8Ps6V5cJVkNiyziPsVD2uAwDXAiyY2lK0f02od5tOmhn lWX+YgQ0/wz3XC4lriaZh3/MvWHt7OGxYwkUSJcnpAcFcp/bVJ01XCZL6r4o9o+CAgdjZTSlr6 eYY= From: Thomas Schwinge To: Richard Biener , CC: , Subject: Re: [PATCH Rust front-end v2 31/37] gccrs: Add GCC Rust front-end Make-lang.in In-Reply-To: References: <20220824115956.737931-1-philip.herron@embecosm.com> <20220824115956.737931-32-philip.herron@embecosm.com> User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/27.1 (x86_64-pc-linux-gnu) Date: Thu, 1 Dec 2022 12:05:39 +0100 Message-ID: <871qpjtmd8.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-13.mgc.mentorg.com (139.181.222.13) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi! On 2022-09-14T15:34:10+0200, Richard Biener via Gcc-patches wrote: > On Wed, Aug 24, 2022 at 2:22 PM wrote: >> --- /dev/null >> +++ b/gcc/rust/Make-lang.in >> +# TODO: possibly find a way to ensure C++11 compilation level here? >> +RUST_CXXFLAGS =3D -std=3Dc++11 -Wno-unused-parameter -Werror=3Doverload= ed-virtual > > You probably should inherit from $(CXXFLAGS) here which ensures C++11 > compatibility. That was done in GCC/Rust commit da13bf4bbc46b399419c3e7f2c358a0efe3bdfdd "make: Inherit CXXFLAGS, remove compiler-specific warnings", which changed this to just 'RUST_CXXFLAGS =3D $(CXXFLAGS)'. > Note you have to deal with non-g++ host compilers when not > bootstrapping so adding -Wno-unused-parameter -Werror=3Doverload-virtual > needs to be guarded. '-Werror=3Doverloaded-virtual' is implied as by default, we have '-Woverloaded-virtual' and '-Werror'. (I've verified via putting 'class tmp : public Dump { void visit (int) {} };' into 'gcc/rust/ast/rust-ast-dump.cc', and getting a number of 'error: =E2=80=98virtual void Rust::AST::Dump::visit([...])=E2=80=99 was hi= dden'.) (Maybe that isn't active for '--disable-bootstrap' builds, but that's "OK".) Remains only '-Wno-unused-parameter'. That one should move into 'rust-warn', where we currently have: >> +# Use strict warnings for this front end. >> +rust-warn =3D $(STRICT_WARN) Per GCC 4.8 documentation (baseline version to bootstrap GCC), we may use '-Wno-[...]' without checking whether the corresponding '-W[...]' is actually supported, so we may specify '-Wno-unused-parameter' unconditionally, like existing ones, for example in 'gcc/Makefile.in': # These files are to have specific diagnostics suppressed, [...] gimple-match.o-warn =3D -Wno-unused generic-match.o-warn =3D -Wno-unused dfp.o-warn =3D -Wno-strict-aliasing I thus understand that non-GCC compilers implement the same '-Wno-[...]' behavior -- or maybe warning flags are not passed to those at all, at stage 1 build where this is (only) relevant. I've thus proposed "'rust-warn +=3D -Wno-unused-parameter'". Gr=C3=BC=C3=9Fe Thomas ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 201= , 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch=C3= =A4ftsf=C3=BChrer: Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellschaf= t: M=C3=BCnchen; Registergericht M=C3=BCnchen, HRB 106955