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
On Thu, Apr 17, 2008 at 4:54 PM, Kyle Sluder
<[EMAIL PROTECTED]> wrote:
> 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 it
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
_
On 18/04/2008, at 9:15 AM, Michael Vannorsdel wrote:
Change it to:
- (void)TestFunction
{
switch (1) {
case 1:
{
NSMutableArray *myArray=[[NSMutableArray alloc]
init];
break;
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 *my
Change it to:
- (void)TestFunction
{
switch (1) {
case 1:
{
NSMutableArray *myArray=[[NSMutableArray alloc]
init];
break;
}
}
}
No need to declare defa
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 a
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:
>
>>
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 an
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 forgot the break;
___
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:
- (vo
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 st
12 matches
Mail list logo