Re: Case label does not reduce to an integer constant
Re: Case label does not reduce to an integer constant
- Subject: Re: Case label does not reduce to an integer constant
- From: Ken Thomases <email@hidden>
- Date: Wed, 10 Nov 2010 20:24:39 -0600
On Nov 10, 2010, at 2:54 PM, Jonathon Kuo wrote:
> Xcode 3.2.4, Cocoa project, .m file.
>
> gcc sees kFlag as an integer in the flag_type assignment, but not when used as a case label?
>
> static const uint32_t kFlag = '3gI7';
> . . .
> uint32_t flag_type = kFlag;
> . . .
> switch (flag_type) {
> case kFlag:
> *** error: case label does not reduce to an integer constant
This is a difference between C and C++. In C++, kFlag is a constant. In C, it's merely a variable with the const qualifier.
Regards,
Ken
_______________________________________________
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