• 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: Steve Mills <email@hidden>
  • Date: Thu, 20 Nov 2008 09:27:55 -0600

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.

Steve Mills
Drummer, Mac geek
http://sjmills5.home.mchsi.com/


_______________________________________________ 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
  • Follow-Ups:
    • Re: get rid of warning "suggest parenthesis around assignment used as truth value"
      • From: Alexander von Below <email@hidden>
  • Prev by Date: Re: get rid of warning "suggest parenthesis around assignment used as truth value"
  • Next by Date: Re: get rid of warning "suggest parenthesis around assignment used as truth value"
  • Previous by thread: Re: get rid of warning "suggest parenthesis around assignment used as truth value"
  • Next by thread: Re: get rid of warning "suggest parenthesis around assignment used as truth value"
  • Index(es):
    • Date
    • Thread