From: Miguel Ojeda <ojeda@kernel.org>
To: dan.j.williams@intel.com
Cc: corbet@lwn.net, gregkh@linuxfoundation.org, joe@perches.com,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
linux@roeck-us.net, max.kellermann@ionos.com,
workflows@vger.kernel.org, Miguel Ojeda <ojeda@kernel.org>
Subject: RE: [PATCH v3] Documentation/process/coding-style.rst: space around const
Date: Thu, 12 Oct 2023 13:50:39 +0200 [thread overview]
Message-ID: <20231012115039.1680561-1-ojeda@kernel.org> (raw)
In-Reply-To: <65271731e25f4_7258329472@dwillia2-xfh.jf.intel.com.notmuch>
On Wed, 11 Oct 2023 14:44:17 -0700, Dan Williams wrote:
>
> I notice that clang-format reflows that example to:
>
> const void *a;
> void *const b;
> void **const c;
> void *const *const d;
> int strcmp(const char *a, const char *b);
>
> ...but someone more clang-format savvy than me would need to propose the
> changes to the kernel's .clang-format template to match the style
> suggestion.
I think we could use:
diff --git a/.clang-format b/.clang-format
index 0bbb1991defe..9eeb511c0814 100644
--- a/.clang-format
+++ b/.clang-format
@@ -671,6 +671,7 @@ SortIncludes: false
SortUsingDeclarations: false
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
+SpaceAroundPointerQualifiers: Both
SpaceBeforeAssignmentOperators: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
At least that makes it match the documentation example -- I got this:
const void *a;
void * const b;
void ** const c;
void * const * const d;
int strcmp(const char *a, const char *b);
But it is only supported in version >= 12, so we need to wait for the
minimum LLVM version bump.
(Thanks for the ping, Joe!)
Cheers,
Miguel
next prev parent reply other threads:[~2023-10-12 11:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-10 12:58 Max Kellermann
2023-10-10 19:24 ` Greg KH
2023-10-10 23:46 ` Guenter Roeck
2023-10-11 0:45 ` Joe Perches
2023-10-11 21:44 ` Dan Williams
2023-10-12 11:50 ` Miguel Ojeda [this message]
2023-10-12 14:48 ` Joe Perches
2023-10-12 16:53 ` Miguel Ojeda
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=20231012115039.1680561-1-ojeda@kernel.org \
--to=ojeda@kernel.org \
--cc=corbet@lwn.net \
--cc=dan.j.williams@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=joe@perches.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=max.kellermann@ionos.com \
--cc=workflows@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox