>>>>> "matthew" == Matthew Wilcox <willy@xxxxxxxxxx> writes:
Hi
matthew> On Mon, Nov 10, 2003 at 02:46:37PM +0100, Duncan Sands wrote:
>> > > The first step would to create a tools that find statemenst like
>> > > if ( (A=b)<0 ). I have played with a grep pipeline and found only
>> > > a few lines of code. perhaps somebody can make a tool that will show
>> > > automaticly such kind of code.
>>
>> What is wrong with "if ( (A=b)< 0)"? Did you find any incorrect uses of
>> this kind of construct in the kernel? By the way, this is just a specific
>> example of a more common situation: statements with side effects.
matthew> It's doing two things in one statement. That's not conducive to
readable
matthew> code. Look:
matthew> A = b;
matthew> if (A < 0)
matthew> can be read faster than
matthew> if ((A = b) < 0)
Specially when 'b' is something like:
long_fun_name(extra_flags, funny_flags, funny_param1, funny_parm2)
Later, Juan.
--
In theory, practice and theory are the same, but in practice they
are different -- Larry McVoy
-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
|