• 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
syntax error crashes cc1obj
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

syntax error crashes cc1obj


  • Subject: syntax error crashes cc1obj
  • From: Bill Monk <email@hidden>
  • Date: Tue, 14 Mar 2006 01:11:23 -0600

I seem to have found a syntax error which reliably crashes cc1obj (Xcode 2.2 and 2.2.1).


The following code, extracted from a larger app, illustrates the situation.


@interface AppController : NSObject {
	NSString *foo;
}
- (void)setFooTo:(NSString *)bar;
@end

@implementation AppController
- (void)awakeFromNib {
	[self setFooTo:@"bar"];
}	

- (void)setFooTo:(NSString *)bar {
	[bar retain];
	[foo release];
    	[foo = bar;    		// <-- Note typo
}
@end


When I build my app, the typo on the last line of setFooTo: causes the following errors/warnings:


error: parse error before ';' token
warning: '@end' missing in implementation context
confused by earlier errors, bailing out

followed by a crash reporter dialog: "The application cc1obj unexpectedly quit."


Fixing the typo allows the app to build with no warnings or errors.


If I then re-apply the typo and save the file, cc1obj launches (observed via top in Terminal - I assume triggered when background compilation kicks in), then crashes as before.


Remove the typo again, save, it compiles fine. Add in the typo again, save, and cc1obj again crashes. This seems to be 100% repeatable.



I tried building a small test app, using just the code above, but the crash doesn't occur, and the build errors are only

error: parse error before ';' token
warning: '@end' missing in implementation context

Apparently it needs to be in the context of the larger app to make the crash occur.


Additionally, in the larger app, the typo must be on the last line before @end, just as in the extract above.
If I move the buggy method closer to the beginning of the file, it produces the following, and no cc1obj crash:


error: parse error before ';' token
At top level:
warning: incomplete implementation of class 'AppController'
warning: method definition for '-setFooTo:' not found


Lastly, the cc1obj crash only occurs with the Release configuration. In the Debug config (with Zero Link on), the typo only produces


error: parse error before ';' token
warning: '@end' missing in implementation context

and cc1obj does not crash.


Admittedly it's a rather long list of prerequisites to cause the problem. But surely a simple syntax error should not make this happen?





_______________________________________________ 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
  • Follow-Ups:
    • Re: syntax error crashes cc1obj
      • From: Daniel Jalkut <email@hidden>
  • Prev by Date: Re: Shared Framework FRAMEWORK_SEARCH_PATHS issue
  • Next by Date: GDB not stopping at breakpoints
  • Previous by thread: Re: printing/debugging from a plugin
  • Next by thread: Re: syntax error crashes cc1obj
  • Index(es):
    • Date
    • Thread