views:

184

answers:

2

The compiler complains about this, after I activated all kind of warnings:

I have an app delegate like this:

#import <UIKit/UIKit.h>

@class MyViewController;

@interface TestAppDelegate : NSObject <UIApplicationDelegate> {
    UIWindow *window;
    MyViewController *myViewController;
}

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

@end

In the implementation file, I have the synthesize code:

@synthesize window;
@synthesize rootViewController;

At the end of the implementation file, the compiler complains:

At top level:
warning: passing argument 3 of 'objc_setProperty' as signed due to prototype
warning: passing argument 5 of 'objc_setProperty' with different width due to prototype
warning: passing argument 6 of 'objc_setProperty' with different width due to prototype
warning: passing argument 3 of 'objc_setProperty' as signed due to prototype
warning: passing argument 5 of 'objc_setProperty' with different width due to prototype
warning: passing argument 6 of 'objc_setProperty' with different width due to prototype

What does that mean? Must I worry about it?

+1  A: 

Yes -- that isn't right. Not at all. And you should worry about it.

When you have a warning like this at the top level, it generally means that there is something screwed up in your header files that is causing problems later.

So, the question is, what? Could be a #define somewhere. Could be a previous declaration of something, specifically a declaration of something in an attempt to fix an error that would be appropriately fixed by #importing the correct system provided header.

Add the full compilation command line that spewed those warnings (you can find it in Xcode).

bbum
+1  A: 

I'm pretty sure you need to file a bug with Apple on this. I presume (having seen this warning) objc_setProperty (a private function, afaict) is used in Apple's implementation of the @synthesize setter code generation. So... this hidden implementation needs to change so the warning is not produced when that warning flag is enabled (GCC_WARN_PROTOTYPE_CONVERSION). These (and other) conditions should have been verified on a larger codebase (consider C++ as well), with more warnings enabled.

Justin