From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id A743C3857413 for ; Wed, 14 Sep 2022 13:39:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A743C3857413 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663162786; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=oYDCQhT+pE/xyJgydl45DWg9z603FqhKs8C8uuZtDpw=; b=jS2PJbR/RqEYaELsV8t26Nynk1spn9LaJ85QLOivCGxYXnI06yu4nAgQ0oYAdAbTIzVgwf HxWSJLgM5C2OJRqMVNfJaLz6wumpRoN2Aya6DA+ycD5bTlxdnhZfFhJTJ4bXUlRWF/otro l658mzgtJJee1zyXkg1SsVPEJnw2WUQ= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-298-qHajhl53PvG2GNYhaoOhLQ-1; Wed, 14 Sep 2022 09:39:45 -0400 X-MC-Unique: qHajhl53PvG2GNYhaoOhLQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A63541C04B57; Wed, 14 Sep 2022 13:39:44 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5CBCC2027061; Wed, 14 Sep 2022 13:39:44 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 28EDdf7D1976278 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 14 Sep 2022 15:39:41 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 28EDderB1976277; Wed, 14 Sep 2022 15:39:40 +0200 Date: Wed, 14 Sep 2022 15:39:39 +0200 From: Jakub Jelinek To: Richard Biener Cc: philip.herron@embecosm.com, The Other , Arthur Cohen , Mark Wielaard , gcc-rust@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: Re: [PATCH Rust front-end v2 09/37] gccrs: Add Lexer for Rust front-end Message-ID: Reply-To: Jakub Jelinek References: <20220824115956.737931-1-philip.herron@embecosm.com> <20220824115956.737931-10-philip.herron@embecosm.com> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_SHORT,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,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 Wed, Sep 14, 2022 at 03:30:39PM +0200, Richard Biener via Gcc-patches wrote: > > +// GCC is distributed in the hope that it will be useful, but WITHOUT ANY > > +// WARRANTY; without even the implied warranty of MERCHANTABILITY or > > +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License > > +// for more details. > > + > > +// You should have received a copy of the GNU General Public License > > +// along with GCC; see the file COPYING3. If not see > > +// . > > + > > +#include "rust-lex.h" > > + > > +#include "rust-system.h" // for rust_assert and rust_unreachable > > +#include "rust-diagnostics.h" // for rust_error_at > > +#include "rust-linemap.h" > > +#include "rust-session-manager.h" > > +#include "safe-ctype.h" > > just diving into a random patch here - I'm assuming I can take rust-lex.cc as > a boiler-plate example for the #include structure. > > In GCC all files should start with #including "config.h" followed by > "system.h" where _all_ system, including C++ standard library headers > should be pulled via system.h to allow working around OS and system > compiler issues. > > It might be that rust-system.h plays the role of config.h + system.h > but then the rust-lex.h include is before it. > > rust-codepoint.h including is also problematic btw. E.g. the Go FE has two parts, one very GCC specific that uses the explicit config.h + system.h etc. includes, the other is generic and there it includes go-system.h in every file first, where that starts with #include various C++ standard includes #include etc. Jakub