lkml.org 
[lkml]   [2023]   [Oct]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH v3] Documentation/process/coding-style.rst: space around const
    From
    Date
    On Thu, 2023-10-12 at 13:50 +0200, Miguel Ojeda wrote:
    > 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.

    Do older versions of clang-format ignore entries
    they don't understand?

    \
     
     \ /
      Last update: 2023-10-12 16:48    [W:6.713 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site