From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 86478 invoked by alias); 15 Feb 2019 20:55:37 -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 86100 invoked by uid 89); 15 Feb 2019 20:55:37 -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_HELO_PASS autolearn=ham version=3.3.2 spammy=maker, a.h, quality, firm X-HELO: gateway31.websitewelcome.com Received: from gateway31.websitewelcome.com (HELO gateway31.websitewelcome.com) (192.185.143.33) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 15 Feb 2019 20:55:35 +0000 Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway31.websitewelcome.com (Postfix) with ESMTP id C3B1E1FA75 for ; Fri, 15 Feb 2019 14:55:33 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id ukWDgil9RdnCeukWDghJ0q; Fri, 15 Feb 2019 14:55:33 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=0P0X57nQrlFUlWDh5ezBrgy3zgKr6ccTWo4S0MDtsYU=; b=O0mrqTQLGzGevnkLefLhXR0wDS z4lFTimu4x2cldAYZ/0libfoW2VSqZw3F3Xr8G1zJugdIotdeQHFsdh+gAn5xmRtYjCu/CM26FkjL E8W6kIrDTq/dcN5uEgysJMsFe; Received: from 75-166-72-210.hlrn.qwest.net ([75.166.72.210]:54204 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1gukWD-003E2G-Hb; Fri, 15 Feb 2019 14:55:33 -0600 From: Tom Tromey To: Pedro Alves Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [RFC] Sort #includes in gdb References: <87fttfmnpq.fsf@tromey.com> Date: Fri, 15 Feb 2019 20:55:00 -0000 In-Reply-To: (Pedro Alves's message of "Mon, 28 Jan 2019 19:08:12 +0000") Message-ID: <878sygydob.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2019-02/txt/msg00261.txt.bz2 >>>>> "Pedro" == Pedro Alves writes: >> I did not push this to the buildbot, as I believe it is too large for >> that as well. Pedro> ISTR that you could point the bot at some branch instead of a patch? I don't know but I will ask Sergio when he's back. Pedro> Yeah, there's a likely chance that this will break some native builds -- there are Pedro> some headers that are (or used to be) order dependent. I remember a small number of Pedro> patches over the years moving header include order particularly in the Pedro> architecture-specific Linux native files, around asm/foo.h, sys/foo.h, headers to Pedro> fix the build in some particular kernel/libc version. ISTR Pedro> as a particular trouble maker, but I could well be misremembering that one. Pedro> I wish I could point at actual code / comments or commits, but I'm not Pedro> finding much. :-/ One thing worth noting is that the rewriting script is not very sophisticated: it understands #include and #if (to a limited extent) but it does not actually handle comments. So, something like: #include /* whatever */ #include ... will not result in any reordering. This is somewhat lame, and I didn't check to see how many files this leaves un-re-written yet; but on the other hand it provides a simple out when ordering is needed. Pedro> BTW, skimming the patch I noticed that the script didn't move Pedro> this conditional include (HAVE_GETAUXVAL): I fixed this. Pedro> What do you think of having separate stanzas for C and C++ system includes? I implemented this. Pedro> A minor one: personally, I think I would prefer that all files from the Pedro> same directory were sorted together. I.e., instead of: I implemented this as well. Pedro> No firm opinion on comments vs no comments. For now at least, I'm sticking with "no comments" because the lack of comment-handling in the script means that adding comments makes the script non-idempotent. But, idempotency is a good quality to have, because it means the script can be re-run at any time to fix any "regressions" that have crept in. Tom