public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Wim de With <nauxuron@wimdewith.com>
To: kernel-janitors@vger.kernel.org
Subject: Breaking lines in function headers
Date: Tue, 19 May 2015 13:22:09 +0000	[thread overview]
Message-ID: <555B3901.3090707@wimdewith.com> (raw)

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)

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



             reply	other threads:[~2015-05-19 13:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-19 13:22 Wim de With [this message]
2015-05-19 13:38 ` Breaking lines in function headers Julia Lawall
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=555B3901.3090707@wimdewith.com \
    --to=nauxuron@wimdewith.com \
    --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