Re: Loco Cocoa Compiler
Re: Loco Cocoa Compiler
- Subject: Re: Loco Cocoa Compiler
- From: Ondra Cada <email@hidden>
- Date: Sun, 2 May 2004 21:00:12 +0200
Adam,
On 2.5.2004, at 20:40, Adam wrote:
>
case NSStreamEventHasBytesAvailable:
>
NSLog(@"NSStreamEventHasBytesAvailable"); //Line 1
>
NSString *newLineChar = @"\n"; //Line 2
>
NSString *carriageReturnChar = @"\r"; //Line 3
>
>
If I run this code it works fine. If I remove line 1 (which was only
>
being used for debugging purposes) I get an error
>
"parse error before '*' token - on line 2
>
This makes no sense to me. These tow lines should not be effecting
>
each other.
That's a pretty old and well-known hiccup of the GCC compiler:
immediately after a case label, you are not allowed to declare
variables.
The old workaround is to add a semicolon:
...
case Whatever:; // look here!
int q; // or any other declaration...
---
Ondra Hada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.