• 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: Compiler Error (expected expression before 'NSArray')
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Compiler Error (expected expression before 'NSArray')


  • Subject: Re: Compiler Error (expected expression before 'NSArray')
  • From: Fritz Anderson <email@hidden>
  • Date: Mon, 15 Feb 2010 15:32:46 -0600

On 15 Feb 2010, at 2:57 PM, Marco S Hyman wrote:

> But this really doesn't have anything to do with C99.
> Inline variable definition is C++ syntax, not C.
> In C variables need to be declared at global scope or
> at the beginning of a compound statement.   The body
> of a function is a compound statement.

Perhaps I misunderstand. I declare variables, in C and Objective-C, in-line all the time. I believe this became standard in C99. A compound statement ({...}) is a sequence of block-items, any of which may be either statements or declarations.

The OP's trouble with switch statements, I believe, is that labels must be followed by statements, and in the standard's syntax terminology, declarations are not statements. ";" alone is a "null statement," which is legal. It can take the curse off a label that has a declaration, or nothing, after it.

	— F

 _______________________________________________
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: 
 >Compiler Error (expected expression before 'NSArray') (From: jeremy <email@hidden>)
 >Re: Compiler Error (expected expression before 'NSArray') (From: Jeremy Pereira <email@hidden>)
 >Re: Compiler Error (expected expression before 'NSArray') (From: Jeremy French <email@hidden>)
 >Re: Compiler Error (expected expression before 'NSArray') (From: Marco S Hyman <email@hidden>)

  • Prev by Date: Re: Upon break, debugger not showing correct line in source
  • Next by Date: Re: Compiler Error (expected expression before 'NSArray')
  • Previous by thread: Re: Compiler Error (expected expression before 'NSArray')
  • Next by thread: Re: Compiler Error (expected expression before 'NSArray')
  • Index(es):
    • Date
    • Thread