• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: get rid of warning "suggest parenthesis around assignment used as truth value"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: get rid of warning "suggest parenthesis around assignment used as truth value"


  • Subject: Re: get rid of warning "suggest parenthesis around assignment used as truth value"
  • From: Alexander von Below <email@hidden>
  • Date: Thu, 20 Nov 2008 19:45:48 +0100


Am 20.11.2008 um 16:27 schrieb Steve Mills:

On Nov 20, 2008, at 07:32:14, Steve Sisak wrote:

if ((foo = 1) != 0) { ... }

or any other boolean test against the result of the assignment will
work as well and is a tad more clear.


That's MUCH more clear, and the correct way to write this code without it being misinterpreted and possibly "corrected" (by changing it to "blah == 1") by yourself or someone else in the future.

True. But this is exactly where the double-parenthesis syntax comes from

Alex
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: get rid of warning "suggest parenthesis around assignment used as truth value" (From: Steve Mills <email@hidden>)

  • Prev by Date: Nothing (reliably) helpful from atos + dSYM
  • Next by Date: Re: Nothing (reliably) helpful from atos + dSYM
  • Previous by thread: Re: get rid of warning "suggest parenthesis around assignment used as truth value"
  • Next by thread: How to use /Developer/MacOSX10.4u.sdk/usr/lib/
  • Index(es):
    • Date
    • Thread