From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Luca Fancellu <Luca.Fancellu@arm.com>
Cc: "Jan Beulich" <jbeulich@suse.com>,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"Roger Pau Monné" <roger.pau@citrix.com>,
"Julien Grall" <julien@xen.org>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Bertrand Marquis" <Bertrand.Marquis@arm.com>,
"Michal Orzel" <Michal.Orzel@amd.com>,
"George Dunlap" <george.dunlap@citrix.com>,
"Wei Liu" <wl@xen.org>,
"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: Clang-format configuration discussion - pt 1
Date: Mon, 13 Nov 2023 15:56:15 +0000 [thread overview]
Message-ID: <65524bd6.7b0a0220.5b797.bbc4@mx.google.com> (raw)
In-Reply-To: <7235E3F4-8387-49D7-A3B6-0EA93CAE408B@arm.com>
On Mon, Nov 13, 2023 at 03:20:53PM +0000, Luca Fancellu wrote:
>
>
> > On 13 Nov 2023, at 11:31, Jan Beulich <jbeulich@suse.com> wrote:
> >
> > On 08.11.2023 10:53, Luca Fancellu wrote:
> > --------------------------------------------------------------------------------------------------------------------------------------------------------------
> >>
> >> Standard: C++03
> >>
> >> ---
> >> From the documentation: Parse and format C++ constructs compatible with this standard.
> >
> > Since I continue to be puzzled - iirc you said this is because of lack
> > of availability of "C99" as a value here. What's entirely unclear to
> > me is: How does this matter to a tool checking coding style (which is
> > largely about formatting, not any lexical or syntactical aspects)?
> >
> >> This value is used also in Linux.
> >
> > Considering how different the two styles are, I don't think this is
> > overly relevant.
On C it _shouldn't_ matter because it's meant to affect C++ constructs
only. That said, clang-format doesn't understand (or care) whether the code
is C or C++, because C's syntax is strictly contained in that of C++ as far
as formatting cares.
While I agree it feels wrong to apply a C++ policy to a C project, it's
largely irrelevant. Setting a value here gives more deterministic output
because it fixes several options' default settings. One would hope none of
those settings affect C, but the world is complex and it's better to be
safe than sorry. Particularly when it's an inocuous one-liner.
There aren't strict C values. And Latest or Auto are simply shorthands for
one of the C++ options.
https://clang.llvm.org/docs/ClangFormatStyleOptions.html#standard
>
> Ok, maybe I understand your point, you are looking for a reason to declare this configurable instead
> of not specifying it at all?
>
> If it’s that, from what I understand clang-format will use the default value if we don’t specify anything
> for this one, so it will take ‘Latest’. I think we should put a value for this one to fix it and don’t have
> surprises if that behaviour changes and seeing that also in Linux that value is fixed increased my
> confidence.
>
> However, if you feel that we should not specify it, I’ve done a test and not specifying it is not changing
> the current output. I can’t say that for a different clang-format version though or if changes happen in the
> future.
>
IMO, C++03 is as good as any other. As long as it's a fixed one.
Cheers,
Alejandro
next prev parent reply other threads:[~2023-11-13 16:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-08 9:53 Clang-format configuration discussion - pt 1 Luca Fancellu
2023-11-13 11:31 ` Jan Beulich
2023-11-13 15:20 ` Luca Fancellu
2023-11-13 15:56 ` Alejandro Vallejo [this message]
2023-11-13 16:27 ` Jan Beulich
2023-11-14 14:59 ` Luca Fancellu
2023-11-14 15:23 ` Alejandro Vallejo
2023-11-14 15:59 ` Jan Beulich
2023-11-14 16:03 ` Luca Fancellu
2023-11-13 13:45 ` George Dunlap
2023-11-13 15:28 ` Luca Fancellu
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=65524bd6.7b0a0220.5b797.bbc4@mx.google.com \
--to=alejandro.vallejo@cloud.com \
--cc=Bertrand.Marquis@arm.com \
--cc=Luca.Fancellu@arm.com \
--cc=Michal.Orzel@amd.com \
--cc=andrew.cooper3@citrix.com \
--cc=george.dunlap@citrix.com \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=wl@xen.org \
--cc=xen-devel@lists.xenproject.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.