Re: latest checkpatch

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

 



On Thu, 18 Oct 2007, Ingo Molnar wrote:

> 
> * Andy Whitcroft <[email protected]> wrote:
> 
> > > it's perfectly legitimate, in fact more robust. So if checkpatch.pl 
> > > wants to make any noise about such constructs it should warn about 
> > > the _lack_ of curly braces in every multi-line condition block 
> > > _except_ the only safe single-line statement:
> > > 
> > > 	if (x)
> > > 		y();
> > 
> > Indeed.  We should probabally do more on the indentation checks in
> > general.  The current direct check for:
> > 
> > 	if (foo);
> > 		bar();
> > 
> > Could probabally be generalised to look for this kind of error:
> > 
> > 	if (foo)
> > 		bar();
> > 		baz();
> > 	one();
> 
> detecting that would be awesome - it's often the sign of a real bug 
> because the intent is often to have bar() and baz() in the conditional 
> block.

Should probably detect these as well (if not yet being done):

	if (abc)
#if...
		def();
		ghi();
#e...


...plus this one:

	if (abc)
#if...
		def();
#endif
	ghi();

...Both of them are clearly bugs.

...and this where either indentation has to be fixed or the bug corrected:

	if (abc)
	def();


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

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux