discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: warnings in ProjectCenter and GNUstep detect


From: Riccardo Mottola
Subject: Re: warnings in ProjectCenter and GNUstep detect
Date: Thu, 07 Apr 2011 18:31:30 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.15) Gecko/20110402 Icedove/3.1.9

Hi
Nope, GCC recommends parentheses for this:

if (sender = debuggerField)

It will say that you probably mean ==, and if you don't then you should use an 
extra set of parentheses.  Clang is warning you here because the GCC warning 
means that double parentheses are used to protect a=b type conditionals, and 
this isn't one but could be a typo if you meant one.

Changing this to:

if (sender == debuggerField)

Or:

if ((sender = debuggerField))

Will make both compilers happy.  The first form is almost certainly what was 
meant, in this case, although I can't be completely sure without seeing the 
surrounding code.


Checking the code, I think the first one is the correct one, it was checking for equality. Otherwise it was really sloppy code. I fixed this it seems to work and I committed it.

Riccardo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]