Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Jason Merrill <jason@redhat.com>
Cc: Tom Tromey <tom@tromey.com>,  Andrew Pinski <pinskia@gmail.com>,
	gdb-patches@sourceware.org,  GCC Mailing List <gcc@gcc.gnu.org>,
	binutils <binutils@sourceware.org>
Subject: Re: [PATCH v4] Add .clang-format
Date: Wed, 10 Dec 2025 12:22:07 -0700	[thread overview]
Message-ID: <871pl22lcw.fsf@tromey.com> (raw)
In-Reply-To: <af2679b0-443a-435d-b02c-fb1e812c59c8@redhat.com> (Jason Merrill's message of "Mon, 13 Oct 2025 09:59:21 +0300")

>>>>> "Jason" == Jason Merrill <jason@redhat.com> writes:

>> IIRC gdb and gcc don't really agree on formatting.  Someone who knows
>> the gcc style well would have to go through all the settings to see.

Jason> How does this file differ from contrib/clang-format?

I finally got around to comparing the two.

The proposed gdb file seems more complete -- it has many more settings.
The gcc file mentions clang-format 7.0.1, but the gdb one was most
recently tested with a minimum version of clang-format 18.

Leaving aside the settings that only appear in the gdb file, gdb and gcc
differ on a few:

* BraceWrapping->AfterNamespace.  gcc uses false but gdb doesn't use a
  custom setting here and relies on BreakBeforeBraces=true.

* ForEachMacros (gdb removed all such macros during C++ification, but it
  wouldn't hurt to share this list)

* ColumnLimit.  gdb uses 79, gcc uses 80.  This is probably unimportant.

* AlignEscapedNewlines: gdb uses Left, gcc uses Right.
  Could go either way on this one.

* AlwaysBreakTemplateDeclarations: gdb uses Yes, gcc uses MultiLine.
  I believe that the essence of the GNU style is that vertical
  space is free.

Anyway these are closer than I thought.  Only programmers could possibly
notice the differences.

Tom

  reply	other threads:[~2025-12-10 19:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-06 18:38 Tom Tromey
2025-10-06 18:42 ` Tom Tromey
2025-10-06 18:46 ` Andrew Pinski
2025-10-06 19:39   ` Tom Tromey
2025-10-08 22:24     ` Simon Marchi
2025-10-13  6:59     ` Jason Merrill
2025-12-10 19:22       ` Tom Tromey [this message]
2025-10-11 22:49 ` Kevin Buettner

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=871pl22lcw.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=binutils@sourceware.org \
    --cc=gcc@gcc.gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=jason@redhat.com \
    --cc=pinskia@gmail.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