Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Pedro Alves <palves@redhat.com>
Cc: Tom Tromey <tom@tromey.com>,  gdb-patches@sourceware.org
Subject: Re: [RFC] Sort #includes in gdb
Date: Fri, 15 Feb 2019 20:55:00 -0000	[thread overview]
Message-ID: <878sygydob.fsf@tromey.com> (raw)
In-Reply-To: <e132876c-15b3-7c47-f765-5c2db103b38e@redhat.com> (Pedro Alves's	message of "Mon, 28 Jan 2019 19:08:12 +0000")

>>>>> "Pedro" == Pedro Alves <palves@redhat.com> 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 <asm/ptrace.h>
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 <z.h>
   /* whatever */
   #include <a.h>

... 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


  parent reply	other threads:[~2019-02-15 20:55 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
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 [this message]
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=878sygydob.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.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