On Monday 10 November 2003 23:16, Matthew Wilcox wrote:
> On Mon, Nov 10, 2003 at 01:06:32PM +0100, Walter Harms wrote:
> > i thing this should (also) go into 2.4.x as well bad style is bad style.
> > the point is to convince the maintainers. But after this incident
> > they will be willing to accept changes that improve readability.
> > (perhaps: somebody can talk to linus to make a statement to remove
> > that kind of code)
> >
> > 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.
>
> the harder ones to remove are:
>
> while (a = b) { ... }
> and
> for (a = 0; a = b; a++) { ... }
> and
> do { ... } while (a = b);
>
> similar kinds of hidden assignments can be done with the comma operator or
> in function calls:
>
> int foo(int);
> int a = 3, b = 4, c;
> c = a, b;
> foo(a = b);
>
> These are all bad style, of course, but I don't think you're going to
> be able to find them all with grep.
But gcc with find them all with gcc -Wall.
-------------------------------------------------------
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/
|