From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 58380 invoked by alias); 27 Jan 2019 04:58:30 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 58371 invoked by uid 89); 27 Jan 2019 04:58:30 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 27 Jan 2019 04:58:28 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 40AE0117C45; Sat, 26 Jan 2019 23:58:27 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Td6OuSnXBWQV; Sat, 26 Jan 2019 23:58:27 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 9A1E8117C40; Sat, 26 Jan 2019 23:58:26 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 2B49A857A4; Sun, 27 Jan 2019 08:58:18 +0400 (+04) Date: Sun, 27 Jan 2019 04:58:00 -0000 From: Joel Brobecker To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [RFC] Sort #includes in gdb Message-ID: <20190127045818.GA15682@adacore.com> References: <87fttfmnpq.fsf@tromey.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87fttfmnpq.fsf@tromey.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-SW-Source: 2019-01/txt/msg00574.txt.bz2 > As discussed previously on the list, here is the patch to sort > includes in gdb. Include files are put into up to 4 stanzas; stanzas > are separated by newlines. The stanzas are: > > 1. For non-header files, the "introductory" headers. First either > defs.h, common/common-defs.h, or server.h, depending on the > location of the source file. Next, if the .c file has a > corresponding .h, that .h. (There is one exception to this rule, > thread-iter.c.) > > 2. System header files, which are determined by the use of <> in the > include. > > 3. Header files that are part of binutils-gdb but not in the gdb > subdirectory -- mostly things coming from libiberty or BFD. > > 4. gdb header files. It might be FUD on my part, but with C & C++, I've always been very nervous about changing the order of #include-s. This is because some headers sometimes define the same macros with different values, and so order can make a difference for those (without really knowing which is more correct, if any, and whether we are in fact getting the one that we should). And of course, this is all highly platform- dependent. I really like, however, the idea of overcoming that fear, and evaluate in practice what the real impact of order is. But since we are getting close to 8.3 branching, could we hold the actual puth until after the 8.3 branch is created? -- Joel