Re: Lindent fixed to match reality

From: Matt Mackall
Date: Thu Jan 29 2004 - 15:01:43 EST


On Thu, Jan 29, 2004 at 11:44:27AM -0800, Linus Torvalds wrote:
>
>
> On Thu, 29 Jan 2004, Matt Mackall wrote:
> >
> > a) (no -psl)
> >
> > void *foo(void) {
> >
> > instead of
> >
> > void *
> > foo(void) {
>
> And why not
>
> void *foo(void)
> {
>
> which is the _right_ thing to use?

Doh, of course the above is what it actually does.

> > b) (no -bs) "sizeof(foo)" rather than "sizeof (foo)"
> > c) (-ncs) "(void *)foo" rather than "(void *) foo"
>
> Hmm.. I don't know about (c), that one tends to vary by usage.

I did a bit of visual grep for counterinstances of c) in core code but
nothing jumped out at me. I'm pretty sure the former is more common
practice and I at least find it helpful visually given the precedence
of cast operators. Thing is, indent feels obliged to force it one way
or the other, so I think it should err on the no space side.

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