Re: Any way to get a warning if a non-boolean type is used in an if expression?
Re: Any way to get a warning if a non-boolean type is used in an if expression?
- Subject: Re: Any way to get a warning if a non-boolean type is used in an if expression?
- From: Sean McBride <email@hidden>
- Date: Fri, 18 Oct 2013 11:25:38 -0400
- Organization: Rogue Research Inc.
On Fri, 18 Oct 2013 00:29:06 -0700, Rick Mann said:
>Anyway, it's pretty clear it doesn't do this now, so I'll just have to
>make the request and hope.
It is open source, you could also implement it yourself. :) Not sure they would accept it, as their policy seems to require warnings that have low false positive rates.
Relatedly, I think a lack of warning on this is even worse:
BOOL x = ...
if (x == YES)
...
Since Obj-C BOOL annoying has 256 different values, comparing against 1 is dangerous. (At least it's easy to search "== YES" periodically.)
Cheers,
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
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