Re: type checking on enums
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