← Back to team overview

kicad-developers team mailing list archive

Re: [PATCH] Fix clang warnings

 

-----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

> On 6/2/2014 6:32 PM, Tomasz Wlostowski wrote:
>> On 02.06.2014 19:52, Bernhard Stegmaier wrote:
>>> Hi,
>>> 
>>> building with clang (at least on OSX) and -Wall is really noisy
>>> so that you can hardly see what’s going wrong. So, I decided to
>>> fix the warnings… attached are 3 patches I prepared (against
>>> rev. 4911):
>>> 
>>> *** clang-warnings-1.diff: Everything that probably should be
>>> fixed:\
>> 
>> Hi Bernhard,
>> 
>> -            if( ip = s1.Intersect( s_next ) ) +            if(
>> (ip = s1.Intersect( s_next )) )
>> 
>> What upsets clang in the first line? I'm asking because I'm
>> unable to get Kicad to build with clang on Linux (wx 3.0) due to
>> compilation errors in wx...
>> 
>> Tom


- -- 
eMails verschlüsseln mit PGP - privacy is your right!
Mein PGP-Key zur Verifizierung: http://pgp.mit.edu

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlONaMgACgkQ/Vb5NagElAXMUACguHNg9t68GxM2MWJy9l8UY3HD
OpkAnRftaFibX/pY2DE1f1fW2ez7nWPZ
=DFmw
-----END PGP SIGNATURE-----



Follow ups

References