From: Andi Kleen on
James Kosin <jkosin(a)intcomgrp.com> writes:
>
> Before everyone jumps in at once, this is a simple example that will
> produce a compiler error about the misplaced else. However if there are
> many if statements above this that may allow the else to be paired up
> with it then the code will compile and there will be a serious and very
> difficult bug in the code that will take days or months to find.

Modern editors with auto indent mode makes it actually very easy
to find such bugs.

Also checkpatch.pl checks for it now I believe.

> Does the compiler produce smaller code without the braces {}?

No, it's very arbitary.

-Andi

--
ak(a)linux.intel.com -- Speaking for myself only.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: James Kosin on
On 3/22/2010 4:13 PM, Andi Kleen wrote:
> James Kosin <jkosin(a)intcomgrp.com> writes:
>
>> Before everyone jumps in at once, this is a simple example that will
>> produce a compiler error about the misplaced else. However if there are
>> many if statements above this that may allow the else to be paired up
>> with it then the code will compile and there will be a serious and very
>> difficult bug in the code that will take days or months to find.
>>
> Modern editors with auto indent mode makes it actually very easy
> to find such bugs.
>
> Also checkpatch.pl checks for it now I believe.
>
Thanks for the speedy reply.

Does this mean developers need to install X or some graphical
environment now to develop the kernel?
If so what options are available to those that don't want a graphical
environment to develop under?

Sorry if I'm old fashioned.

Thanks again,
James K.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Andi Kleen on
On Mon, Mar 22, 2010 at 04:33:55PM -0400, James Kosin wrote:
> On 3/22/2010 4:13 PM, Andi Kleen wrote:
> > James Kosin <jkosin(a)intcomgrp.com> writes:
> >
> >> Before everyone jumps in at once, this is a simple example that will
> >> produce a compiler error about the misplaced else. However if there are
> >> many if statements above this that may allow the else to be paired up
> >> with it then the code will compile and there will be a serious and very
> >> difficult bug in the code that will take days or months to find.
> >>
> > Modern editors with auto indent mode makes it actually very easy
> > to find such bugs.
> >
> > Also checkpatch.pl checks for it now I believe.
> >
> Thanks for the speedy reply.
>
> Does this mean developers need to install X or some graphical
> environment now to develop the kernel?

Modern was perhaps the wrong word. emacs, vim support that.

-Andi

--
ak(a)linux.intel.com -- Speaking for myself only.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/