From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7405 invoked by alias); 6 Apr 2019 19:29:23 -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 7384 invoked by uid 89); 6 Apr 2019 19:29:22 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_SHORT,SPF_PASS autolearn=ham version=3.3.1 spammy=H*r:sk:client-, H*r:sk:server-, forgotten, H*RU:sk:smtp.fr X-HELO: mx2.freebsd.org Received: from mx2.freebsd.org (HELO mx2.freebsd.org) (8.8.178.116) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 06 Apr 2019 19:29:21 +0000 Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx2.freebsd.org (Postfix) with ESMTPS id 6AD8C79603; Sat, 6 Apr 2019 19:29:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A56A68E44F; Sat, 6 Apr 2019 19:29:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (unknown [IPv6:2601:648:8880:1e30:68c8:8f4e:507:224a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 2D30911828; Sat, 6 Apr 2019 19:29:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: [FYI] Sort includes for files gdb/[a-f]*.[chyl]. To: Tom Tromey Cc: Andreas Schwab , gdb-patches@sourceware.org References: <20190406011654.28798-1-tom@tromey.com> From: John Baldwin Openpgp: preference=signencrypt Message-ID: <45086ce5-2528-2cc0-4008-e250aa4c0e98@FreeBSD.org> Date: Sat, 06 Apr 2019 19:29:00 -0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A56A68E44F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.99 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.99)[-0.990,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US] X-IsSubscribed: yes X-SW-Source: 2019-04/txt/msg00094.txt.bz2 On 4/5/19 11:48 PM, Andreas Schwab wrote: > On Apr 05 2019, Tom Tromey wrote: > >> diff --git a/gdb/aarch64-fbsd-nat.c b/gdb/aarch64-fbsd-nat.c >> index bb187a600d0..cb4130a2844 100644 >> --- a/gdb/aarch64-fbsd-nat.c >> +++ b/gdb/aarch64-fbsd-nat.c >> @@ -18,16 +18,18 @@ >> along with this program. If not, see . */ >> >> #include "defs.h" >> -#include "target.h" >> >> -#include >> -#include >> +/* Standard C includes. */ >> #include >> +#include >> +#include > > These are not really "Standard C includes". I agree that these are pretty OS-specific. Also, FreeBSD doesn't make all of its headers standalone and sys/types.h probably has to come first before any other sys/*.h, etc. (I had forgotten about this until now). You can think of (or if needed) as being like GDB's "defs.h". As it is, my guess is that this change doesn't compile as almost certainly uses types defined in on all FreeBSD architectures. The sorting rules that FreeBSD uses in its source tree is something like: or (but not both) (sorted) (sorted which naturally groups them by subdir) <*.h> (sorted) I'm not sure if we want to treat sys/types.h special in your script, but POSIX in the past did used to require it before other headers (e.g. socket() used to formally require before ). I'm also not sure if we want to sort before other groups, but FreeBSD might very well need that at least. I'm fine with fixing any build breakages post commit (I know there aren't any functional FreeBSD buildbots currently). I just don't know how much you care about the script being completely correct. It might also depend on if any of the non-nat files that include end up breaking on FreeBSD (or other OS's) after the sorting changes. I'm happy to pull down a branch and do a test build if that would work best for you. The one use of sys/param.h in the tree is bsd-kvm.c which is effectively a nat file only used on the BSD's and the natural sort order of the sys/*.h headers in that file would sort correctly anyway FWIW. -- John Baldwin