Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simple bug crashes hangs Xcode

I have build the simplest possible iPhone program, a window based program. I only changed the testappdelegate.h file to be the following:

#import <UIKit/UIKit.h>

@interface TestAppDelegate : NSObject <UIApplicationDelegate> {
    UIWindow *window;
    int pos[10]10]; //note the error here.
}

@property (nonatomic, retain) IBOutlet UIWindow *window;

@end

Note the error in the 'int pos...' line.

When I try to compile this program XCode hangs (showing millions of errors). I am not asking how to fix the line, the fix is obvious.

The problem is that overwhelms XCode and I want to know why?

Update: submitted bug report Bug ID# 8406197

Update2: Sept 24. I got a response from Apple Engineering has provided the following information:

We don't plan to fix this in llvm-gcc or gcc, and it is already fixed in clang. Xcode not freaking out is tracked in a clone of this bug.

We are now closing this bug since our engineers are aware of the issue and will continue to track it offline.

like image 211
John Smith Avatar asked Sep 08 '10 16:09

John Smith


2 Answers

The issue is that Xcode is having to ingest those millions of errors to try and figure out if there is a line of code that needs annotation.

Please file a bug via http://bugreport.apple.com/.

That you have produced such a simple test case will help the engineering team to ensure that any fixes they may be pursuing address the problem sufficiently. There are potentially two bugs here; the first for Xcode to handle such a volume of errors gracefully and the second for the compiler to not spew so much in the face of such an obvious error.

It is likely that your bug(s) will be returned as known duplicates. That only happens, though, after the engineering team has captured any unique information from your bug. That is to say, dupes are often very useful.

When filing the bug, add the bug # to your SO question. Many Apple engineers cruise SO and will click through to followup internally.

like image 106
bbum Avatar answered Oct 14 '22 05:10

bbum


Some errors, the compiler doesn't know what to do next.

The fact that the syntax error appears to be one local to a single line to you, a human, doesn't mean necessarily mean that there was a simple rule that was obvious to the compiler writer.

like image 31
hotpaw2 Avatar answered Oct 14 '22 05:10

hotpaw2