Em Qua, 2007-10-10 às 11:59 -0400, Alan Cox escreveu:
LOL
Yes, this is not a severe CodingStyle violation. Still, the above code
is better than the used one.
Since, on your example, it is clear that the programmer wanted to test
if the value is less than zero.
The code:
if ( (err=foo()) )
should also indicate an operator mistake of using =, instead of ==.
Probably, source code analyzers like Coverity will complain about the
above.
If not violating CodingStyle, I would rather prefer to code this as:
if ( !(err=foo() )
or, even better, using:
if ( (err=foo()) != 0)
clearly indicating that it is tested if the value is not zero.
Even being a quite simple issue, I would prefer if Jiri can fix it.
--
Cheers,
Mauro
-