20.05.2011 13:57, marius adrian popa wrote:

> If i compile firebird 3.x with clang++ i have a lot of warnings also
> you reproduce with g++ if you add
> -Wparentheses (maybe it should be added to the default g++ flags in
> devel flags on linux/posix)
> "using the result of an assignment as a condition without parentheses"
> https://gist.github.com/982655
>
> and the fix is easy : add the extra () parenthesis in case there is a
> assignment and the results will be passed to the if / while

Just for the record, in the past we had a convention of writing:

   if ( (assignment) )

rather than:

   if ((assignment))

to mark such places better, for the later review / refactoring.

I'm not sure it's strictly followed nowadays, but it looked like a good 
idea that time.


Dmitry

------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its 
next-generation tools to help Windows* and Linux* C/C++ and Fortran 
developers boost performance applications - including clusters. 
http://p.sf.net/sfu/intel-dev2devmay
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to