From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14393 invoked by alias); 6 Nov 2010 21:43:01 -0000 Received: (qmail 14382 invoked by uid 22791); 6 Nov 2010 21:43:01 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 06 Nov 2010 21:42:55 +0000 Received: (qmail 19426 invoked from network); 6 Nov 2010 21:42:53 -0000 Received: from unknown (HELO digraph.polyomino.org.uk) (joseph@127.0.0.2) by mail.codesourcery.com with ESMTPA; 6 Nov 2010 21:42:53 -0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.72) (envelope-from ) id 1PEqXE-0006ty-Av; Sat, 06 Nov 2010 21:42:52 +0000 Date: Sat, 06 Nov 2010 21:53:00 -0000 From: "Joseph S. Myers" To: Ian Lance Taylor , gcc-patches@gcc.gnu.org Subject: Re: Go front end review: files outside gofrontend/ In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2010-11/txt/msg00655.txt.bz2 A further comment on go-system.h: It is always necessary for code in GCC to include config.h before any system headers. Thus, the includes #include #include #include #include #include are unsafe because they appear before the include of config.h. In particular, feature test macros such as those for large-files support (which is now enabled in GCC) may be defined in config.h and may only be effective if defined before any system headers are included - and C++ system headers may include C system headers. If the issue described in // These must be included before the #poison declarations in system.h. arises then I think the answer is for system.h to include some C++ headers, when compiling as C++, before the problem #poison declarations, just as it includes various C headers. A suitable set of C++ header includes might also eliminate many of the #include <...> directives in individual files in the front end. If a source file directly includes a <...> system header, there should be a clear reason why that include is not in system.h (for example, deliberately deciding that certain interfaces such as those from GMP and MPFR should only be used in certain parts of the compiler - especially where using a header may result in library dependencies not desired for programs such as the driver). -- Joseph S. Myers joseph@codesourcery.com