------- Comment #7 from manu at gcc dot gnu dot org 2010-02-21 00:30 ------- (In reply to comment #3) > As another data-point, > > if ( (a=10) ) ; > > also doesn't warn. I'm not sure what the standard says on that, but other > contemporary compilers do give the an "assignment used as truth value" warning > for the example above. >
How do other compilers deal with false positives? That is, how can a programmer specify that they really want to do an assignment? We could use a cast to bool. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25733