• 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: Any way to get a warning if a non-boolean type is used in an if expression?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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: Jeffrey Walton <email@hidden>
  • Date: Fri, 18 Oct 2013 05:40:36 -0400

On Fri, Oct 18, 2013 at 3:29 AM, Rick Mann <email@hidden> wrote:
>
> On Oct 17, 2013, at 17:28 , Thomas Wetmore <email@hidden> wrote:
>
>> As a long time Bell Labs engineer and a C purist, allow me to quote from the C specification from the K&R bible:
>
> Those of you quoting the language spec are missing my intent/need. While I consider this a shortcoming of the language, I realize this is how the language is. This is why I'm looking for a warning, not an error.
> ...
> I'm asking for a modern compiler that can do a lot of semantic analysis to give me the option of warning me when I'm doing something that's very easy to do accidentally in Objective-C.
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.

Also see "More 'bool' weirdness",
http://lists.apple.com/archives/xcode-users/2013/Jun/msg00095.html

Jeff
 _______________________________________________
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: Any way to get a warning if a non-boolean type is used in an if expression?
      • From: Sean McBride <email@hidden>
References: 
 >Re: Any way to get a warning if a non-boolean type is used in an if expression? (From: Sean McBride <email@hidden>)
 >Re: Any way to get a warning if a non-boolean type is used in an if expression? (From: Thomas Wetmore <email@hidden>)

  • Prev by Date: Re: Any way to get a warning if a non-boolean type is used in an if expression?
  • Next by Date: Re: Any way to get a warning if a non-boolean type is used in an if expression?
  • Previous by thread: Re: Any way to get a warning if a non-boolean type is used in an if expression?
  • Next by thread: Re: Any way to get a warning if a non-boolean type is used in an if expression?
  • Index(es):
    • Date
    • Thread