• 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: type checking on enums
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: type checking on enums


  • Subject: Re: type checking on enums
  • From: Alastair Houghton <email@hidden>
  • Date: Wed, 12 Dec 2007 12:50:36 +0000

On 12 Dec 2007, at 12:39, Perry Winkel wrote:

in my (legacy) code, i have statements like

switch(itsresulttype){
	case 0: <some statement>
	case 1: <some statement>
	case 2: <some statement>
	}

i would very much Xcode to report a syntax error on this but i somehow can not find an option with an approriate name, can someone hint me on where to look for it and how it is named?

I doubt that there is one. You can get it to warn if you haven't covered all the cases, but I don't think there's anything to prevent you from using integers. It wouldn't really make sense to have such a warning, because in C as I'm sure you're aware, enums and ints are intentionally interchangeable.


Of course, I'd be happy to be proved wrong :-)

Kind regards,

Alastair.

--
http://alastairs-place.net


_______________________________________________ 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
References: 
 >type checking on enums (From: Perry Winkel <email@hidden>)

  • Prev by Date: Re: pragma nowarn
  • Next by Date: Re: How does the compiler figure out conflicting return types, and why no warnings?
  • Previous by thread: type checking on enums
  • Next by thread: How does the compiler figure out conflicting return types, and why no warnings?
  • Index(es):
    • Date
    • Thread