From: Julia Lawall <julia.lawall@lip6.fr>
To: kernel-janitors@vger.kernel.org
Subject: Re: Breaking lines in function headers
Date: Tue, 19 May 2015 13:38:17 +0000 [thread overview]
Message-ID: <alpine.DEB.2.10.1505191537160.2694@hadrien> (raw)
In-Reply-To: <555B3901.3090707@wimdewith.com>
On Tue, 19 May 2015, Wim de With wrote:
> What is the correct way to break lines in a function header? The coding
> style guide is not very clear about it. For example:
>
> 1.
> static struct very_long_struct_name
> *do_something_interesting(struct *another_long_struct_name)
>
> 2.
> static struct very_long_struct_name *do_something_interesting(
> struct *another_long_struct_name)
I don't recall ever seeing the second one. But perhaps one doesn't see
what one doesn't look for. In the first one, it seems odd to separate the
* from the rest of the return type. I would think it would be very easy
to miss/misinterpret alone before the function name.
julia
> Which one of these is the correct way to do it? I see the second one
> used more often, and the coding style guide states "Descendants are
> always substantially shorter than the parent and are placed
> substantially to the right. The same applies to function headers with a
> long argument list.", so I am inclined to say it is the correct way of
> doing it. But if it is, how many tabs should I use? How should I align
> the arguments if the list is longer, and I need more line breaks?
>
> Thanks
>
> Wim
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2015-05-19 13:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-19 13:22 Breaking lines in function headers Wim de With
2015-05-19 13:38 ` Julia Lawall [this message]
2015-05-19 14:08 ` Dan Carpenter
2015-05-19 15:14 ` Wim de With
2015-05-19 15:20 ` Dan Carpenter
2015-05-19 15:26 ` Wim de With
2015-05-19 15:39 ` Dan Carpenter
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=alpine.DEB.2.10.1505191537160.2694@hadrien \
--to=julia.lawall@lip6.fr \
--cc=kernel-janitors@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