[lkml]   [2003]   [Jun]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Question about style when converting from K&R to ANSI C.
Linus Torvalds ( wrote:
> In article <>,
> Larry McVoy <> wrote:
>>On Sat, May 31, 2003 at 11:56:16PM -0600, Steven Cole wrote:
>>> Proposed conversion:
>>> int foo(void)
>>> {
>>> /* body here */
>>> }
>>Sometimes it is nice to be able to see function names with a
>> grep '^[a-zA-Z].*(' *.c
>>which is why I've always preferred
>> /* body here */
> That makes no sense.

But it does. Type /^foo <enter> and you're at the function definition. At
least when using vi, which is the editor everybody's using, right? ;-)

Also, when in working in a (too) long function body, type ?^{ and you're
at the start of the function body.

> Do you write your normal variable definitions like
> int
> a,b,c;
> too? No you don't, because that would be totally idiotic.

Indeed, searching for ^a will fail. There's no reason whatsoever why you'd
declare your variables that way.

Erik Hensema <>
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

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