Re: Declaration in "for"
Re: Declaration in "for"
- Subject: Re: Declaration in "for"
- From: "A.M." <email@hidden>
- Date: Fri, 23 Nov 2007 00:16:16 -0500
On Nov 22, 2007, at 11:43 PM, Gordon Apple wrote:
for (NSInteger index = 0;.....
OK, what's the magic compiler/XCode setting to get rid of the
error
message on this? 10.5, no error in sample code, but my project's
compiler
complains about it not being C99 compliant. I understand the
problem -- I
just need to know what to set to so it doesn't complain every time
I purloin
code from sample code. I tried side-by-side project settings but
couldn't
figure out what was set different.
You need to change "C Language Dialect" to something like c99- the
default seems to be ANSI C:
int main()
{
for(int i=0;;);
return 0;
}
~ agentm$ gcc test.c
test.c: In function 'main':
test.c:3: error: 'for' loop initial declaration used outside C99 mode
~ agentm$ gcc -std=c99 test.c
~ agentm$
_______________________________________________
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