From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julia Lawall Date: Tue, 19 May 2015 13:38:17 +0000 Subject: Re: Breaking lines in function headers Message-Id: List-Id: References: <555B3901.3090707@wimdewith.com> In-Reply-To: <555B3901.3090707@wimdewith.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kernel-janitors@vger.kernel.org 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 >