netdev
[Top] [All Lists]

Re: CodingStyle: while ((a=b))

To: Chris Wedgwood <cw@xxxxxxxx>
Subject: Re: CodingStyle: while ((a=b))
From: "chas williams (contractor)" <chas@xxxxxxxxxxxxxxxx>
Date: Sun, 27 Jun 2004 00:07:08 -0400
Cc: "David S. Miller" <davem@xxxxxxxxxx>, shemminger@xxxxxxxx, netdev@xxxxxxxxxxx, Linus Torvalds <torvalds@xxxxxxxx>
In-reply-to: Your message of "Sat, 26 Jun 2004 18:25:04 PDT." <20040627012504.GB14444@xxxxxxxxxxxxxxxxxxxxx>
Reply-to: chas3@xxxxxxxxxxxxxxxxxxxxx
Sender: netdev-bounce@xxxxxxxxxxx
In message <20040627012504.GB14444@xxxxxxxxxxxxxxxxxxxxx>,Chris Wedgwood writes:
>I'm not sure this has ever been a problem in the past has it?

as a counter example, tired eyes (and the compiler!) cant tell
the difference between:

        while ((a = b))
        if ((a = b))

and

        while ((a == b))
        if ((a == b))

so i just tend to shy away from assignments in conditions.

<Prev in Thread] Current Thread [Next in Thread>