lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ