Weird build error

2008-04-17 Thread Don Arnel
I've been working on a project for a few weeks now and suddenly today I get this error while building (see below). I was getting this same error in one of my real classes so after commenting out almost every bit of code and still seeing the error, I decided to just create a new TestClass

Re: Weird build error

2008-04-17 Thread Robert Kukuchka
you forgot the break; On 17-Apr-08, at 3:47 PM, Don Arnel wrote: I've been working on a project for a few weeks now and suddenly today I get this error while building (see below). I was getting this same error in one of my real classes so after commenting out almost every bit of code and

Re: Weird build error

2008-04-17 Thread Hamish Allan
On Fri, Apr 18, 2008 at 12:47 AM, Don Arnel [EMAIL PROTECTED] wrote: switch (1) { default: } (x)(error: label at end of compound statement) You need a statement to execute for the default case. The code you have written is equivalent to: -

Re: Weird build error

2008-04-17 Thread Jonathan del Strother
On Thu, Apr 17, 2008 at 11:47 PM, Don Arnel [EMAIL PROTECTED] wrote: I've been working on a project for a few weeks now and suddenly today I get this error while building (see below). I was getting this same error in one of my real classes so after commenting out almost every bit of code and

Re: Weird build error

2008-04-17 Thread Keary Suska
on 4/17/08 4:56 PM, [EMAIL PROTECTED] purportedly said: A break; is not required, but it does cause the compound statement error to go away. Even with the break; inserted the other error still occurs if the comments are removed. On Apr 17, 2008, at 6:50 PM, Robert Kukuchka wrote: you

Re: Weird build error

2008-04-17 Thread Wayne Packard
The break isn't required, but something is. You could put NSLog(@defaulting); after default:. Or you could put a semicolon; or a lovely set of empty braces. To fix the other problem, try this: switch (1) { case 1: { NSMutableArray *myArray=[[NSMutableArray

Re: Weird build error

2008-04-17 Thread Michael Vannorsdel
Change it to: - (void)TestFunction { switch (1) { case 1: { NSMutableArray *myArray=[[NSMutableArray alloc] init]; break; } } } No need to declare

Re: Weird build error

2008-04-17 Thread Don Arnel
Ah, that did the trick! I love mailing lists! Many thanks to all who responded. On Apr 17, 2008, at 7:15 PM, Michael Vannorsdel wrote: Change it to: - (void)TestFunction { switch (1) { case 1: { NSMutableArray

Re: Weird build error

2008-04-17 Thread Kyle Sluder
GCC is alerting you to the fact that the switch at the end of the statement is unnecessary. If you really want to do something for all cases, use default. Otherwise just omit it. Using the empty statement (; by itself) will fool GCC, but an empty default case is useless. --Kyle Sluder

Re: Weird build error

2008-04-17 Thread Chris Suter
On 18/04/2008, at 9:54 AM, Kyle Sluder wrote: GCC is alerting you to the fact that the switch at the end of the statement is unnecessary. That's not what GCC is trying to do; GCC is trying to alert you to the fact that it's invalid syntax. As I just said in my earlier e-mail, labels must