Re: Breaking lines in function headers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 19, 2015 at 4:22 PM, Wim de With <nauxuron@xxxxxxxxxxxxx> 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)
>
> 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?

First of gmail always marks your emails as spam so I only see the
replies.

Both declaration formats are acceptable.

These days instead of "substantially to the right" most people
insist that they be aligned.  I think checkpatch.pl --strict enforces
this.

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux