On Fri, May 20, 2011 at 1:14 PM, Dmitry Yemanov <firebi...@yandex.ru> wrote: > 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.
from visibility point of view i agree it's more clear too see that paratheses doubled Maybe it should be added to the coding style http://www.firebirdtest.com/en/coding-style/ ------------------------------------------------------------------------------ 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