lkml.org 
[lkml]   [2003]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Question about style when converting from K&R to ANSI C.
Larry McVoy wrote:
>>Proposed conversion:
>>
>>int foo(void)
>>{
>> /* body here */
>>}
>
> which is why I've always preferred
>
> int
> foo(void)
> {
> /* body here */
> }
>
> Is there some reason that I'm missing that the kernel folks like it the other
> way?

Just my personal opinion:

The return value is part of the function signature; placing it on a
separate line implies a disconnect between the return value and the rest
of the declaration.

It's a matter of psychology; your mileage may vary.

--
Scott Robert Ladd
Coyote Gulch Productions (http://www.coyotegulch.com)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:35    [W:0.180 / U:0.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site