lkml.org 
[lkml]   [2001]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [BUG] Bad #define, nonportable C, missing {}
From
Date
On Wed, 21 Nov 2001, Vincent Sweeney wrote:
>>
>> drivers/block/paride/pf.c: if (l==0x20) j--; targ[j]=0;
>> drivers/block/paride/pg.c: if (l==0x20) j--; targ[j]=0;
>> drivers/block/paride/pt.c: if (l==0x20) j--; targ[j]=0;
>> (these files need Lindenting too)
>> ----------
>> Missing {} Either a bug or a very bad style (so bad that I can even
>> imagine that it is NOT a bug). Please double check before applying
>> the patch! -- vda
>
> C std says IFF you have one expression after the for() then you can
> omit the {}'s. So this is NOT a bug or bad coding style its just
> saving some bytes in the source code :)

The point here is that what is written as

if(l==0x20) j--; targ[j]=0;

is actually

if(l==0x20)
j--;
targ[j]=0;

and not the

if(l==0x20){
j--;
targ[j] = 0;
}

that it appears to be. I wouldn't like to use 'l' as a variable
either, but that's just me.

Cheers,
Chris
-
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:13    [W:0.136 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site