lkml.org 
[lkml]   [2021]   [Oct]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH v4] docs: Explain the desired position of function attributes
    On Sat, Oct 2, 2021 at 8:31 AM Greg KH <gregkh@linuxfoundation.org> wrote:
    >
    > Why would documenting the expected format have an affect on tools not
    > being able to follow that exact expected format? Are we defining a
    > format that is somehow impossible for them to use?

    From a quick test, clang-format-12 with our current config keeps
    attributes in the same line and it does not seem to reorder them, so
    it seems OK (the developer has to do it by hand, but that is fine)
    except for the `__malloc` in the second example which is in a
    different line (but not in the first). Is that intended?

    > If anything I would think that now we have a format that the tools can
    > actually follow, while before it was semi-random as to what to pick as
    > the "one true way".

    In the future, clang-format could have a configuration option to pass
    a sort order, in which case, having the sort order already defined in
    the kernel would definitely be helpful.

    In fact, we could use the fact that the kernel has one as a way to
    tell upstream that such a feature would be nice to have :)

    Cheers,
    Miguel

    \
     
     \ /
      Last update: 2021-10-02 12:43    [W:6.010 / U:0.136 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site