Re: Unnecessary Boolean Warning
Re: Unnecessary Boolean Warning
- Subject: Re: Unnecessary Boolean Warning
- From: Sean McBride <email@hidden>
- Date: Mon, 01 Aug 2011 11:56:37 -0400
- Organization: Rogue Research Inc.
On Sun, 31 Jul 2011 15:13:45 -0500, Gordon Apple said:
>The following expression generates a warning message (3&&2 within 3||2) and
>says to include the 3anded2 expression in parens. Anybody who understands
>basic boolean operator precedence knows this is unnecessary. Bug report?
>
> BOOL isInUse = [super mediaIsInUse];
> isInUse = isInUse || [self videoIsOn] && ([[self capMgr] isRecording]
> || [[self camVC]
>movieIsPlaying]
> || [[self camVC]
>movieIsPaused]);
This warning has found several bugs (ie incorrect programmer recollection of precedence rules) in at least 2 open source projects I use. I'm glad we have it. Turn it off it offends you so.
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden