Folks,
We're trying to upgrade and build our iPhone project with Xcode 3.2.3. Our project links with a static library/framework, and, as such, the source for this framework is rebuilt every time with our project. Under Xcode 3.2.2, this framework built without warnings or issues. Under 3.2.3, the code is failing to build with the following error:
warning: format not a string literal and no format arguments
Note that I said error, even though the output says warning. Xcode flags this in red and fails to build the project because of it. Here is the code which is generating this error:
NSString * const MyException = @"MyException"; static NSString * const ExceptionMessage = @"Bindings are not supported on the iPhone in Core Plot";
-(void)aMethod:(NSObject *)anObject { #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE [NSException MyException format:ExceptionMessage];
So, I have a few questions: 1) the format is definitely a string literal, so why is the first part of this warning being generated (or is the grammar of the warning wrong/bad, and should it say "format not a string literal OR no format arguments") 2) why is this an error that is causing the build to fail 3) why is the behavior of the build different from 3.2.2 to 3.2.3?
What I've found is that, if I change the code as follows:
-(void)aMethod:(NSObject *)anObject { #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE [NSException MyException format:@"Bindings are not supported on the iPhone in Core Plot"];
There is no warning or error at all, even though the format still has no arguments. I would at least expect to still get a warning that I have no arguments to format. Further, if I create code in the main project (remembering that this code in question is in a static framework) that mirrors the original version of the code above, I get a build warning and not a build error. So, as part of the same build, the same errant code in one spot generates a true warning and in another spot generates an error.
If anyone can help me to understand what the heck is going on, I would greatly appreciate it.
Regards, Paul |