← Back to team overview

kicad-developers team mailing list archive

Re: [PATCH] Fix clang warnings

 

Uhhh, or you could just split it up, like people do in other languages.

ip = s1.Intersect(s_next);
if (ip != 0) {
}


On 6/3/2014 2:18 AM, Heiko Rosemann wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 06/03/2014 04:49 AM, tiger12506 wrote:
This is a guess (i'm not OP), but it's pretty common to shun
assignment within an if condition. The second line probably just
masks the warning from the compiler -- the check that triggers the
warning probably isn't exhaustive enough to check within the
parentheses for assignment.
Probably the way to do this formally correct and without relying on
implicit integer-boolean conversion would be the following:
if( (ip = s1.Intersect( s_next )) != 0 )

Heiko


References