• 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: Declaration in "for"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Declaration in "for" (From: Gordon Apple <email@hidden>)

  • Prev by Date: Declaration in "for"
  • Next by Date: Re: Renaming files
  • Previous by thread: Declaration in "for"
  • Next by thread: Re: Declaration in "for"
  • Index(es):
    • Date
    • Thread