[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231012115039.1680561-1-ojeda@kernel.org>
Date: Thu, 12 Oct 2023 13:50:39 +0200
From: Miguel Ojeda <ojeda@...nel.org>
To: dan.j.williams@...el.com
Cc: corbet@....net, gregkh@...uxfoundation.org, joe@...ches.com,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux@...ck-us.net, max.kellermann@...os.com,
workflows@...r.kernel.org, Miguel Ojeda <ojeda@...nel.org>
Subject: RE: [PATCH v3] Documentation/process/coding-style.rst: space around const
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
Powered by blists - more mailing lists