From: Joel Brobecker <brobecker@adacore.com>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFC] Sort #includes in gdb
Date: Sun, 27 Jan 2019 04:58:00 -0000 [thread overview]
Message-ID: <20190127045818.GA15682@adacore.com> (raw)
In-Reply-To: <87fttfmnpq.fsf@tromey.com>
> 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
next prev parent reply other threads:[~2019-01-27 4:58 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-26 15:40 Tom Tromey
2019-01-27 4:58 ` Joel Brobecker [this message]
2019-02-15 20:46 ` Tom Tromey
2019-01-28 19:08 ` Pedro Alves
2019-01-28 22:31 ` Matt Rice
2019-02-15 20:55 ` Tom Tromey
2019-03-15 23:13 ` Tom Tromey
2019-03-20 17:42 ` Pedro Alves
2019-03-29 20:52 ` Tom Tromey
2019-03-29 21:05 ` Simon Marchi
2019-03-30 18:35 ` Tom Tromey
2019-04-03 18:58 ` Pedro Alves
2019-04-03 19:29 ` Sergio Durigan Junior
2019-04-03 20:34 ` Sergio Durigan Junior
2019-04-04 2:47 ` Tom Tromey
2019-04-04 3:40 ` Sergio Durigan Junior
2019-04-03 19:00 ` Pedro Alves
2019-04-03 20:11 ` Tom Tromey
2019-04-03 21:00 ` Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190127045818.GA15682@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox