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:20:31 -0400
- Organization: Rogue Research Inc.
On Fri, 18 Oct 2013 05:40:36 -0400, Jeffrey Walton said:
>Microsoft compiler have the warning (see, for example,
>http://msdn.microsoft.com/en-us/library/b6801kcy.aspx). The last time
>I checked, GCC and Clang do not.
You can try easily with clang's -Weverything. Clang does not have an equivalent of MSVC's C4800. That said, it's not clear that C4800 is what Rick is asking for. It's for assigning to a bool variable, and, as was said in this thread, the 'parameter' to an 'if' statement is not bool but int.
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