Why is 'missing sentinel in function call' appearing?
Why is 'missing sentinel in function call' appearing?
- Subject: Why is 'missing sentinel in function call' appearing?
- From: Tito Ciuro <email@hidden>
- Date: Thu, 14 Oct 2010 17:25:15 -0300
Hello,
I'm seeing a weird behavior in Xcode 3.2.4/GCC 4,2. The warning I'm getting is: missing sentinel in function call
This is how I have defined the methods:
+ (NSFSomeClass*)someClassWithObjects:(NSArray *)someObjects
{
return [[[self alloc]initWithObjects:someObjects]autorelease]; <<<<<<<<<<<< warning occurs here
}
- (id)initWithObjects:(NSArray *)someObjects
{
if (self = [self init]) {
...
}
return self;
}
However, if I change the class method to the following, the warning disappears:
+ (NSFSomeClass*)someClassWithObjects:(NSArray *)someObjects
{
return [[[self alloc]initWithObjects:someObjects, nil]autorelease];
}
Any idea why this is happening? Why does it require a sentinel when I'm passing an array? Another observation:
GCC 4.0 = no warning
GCC 4.2 = warning
LLVM GCC 4.2 = warning
LLVM compiler 1.5 = no warning
Is this a GCC 4.2/LLVM GCC4.2 bug?
And while we're at it... since the library I'm writing works on both Mac OS X and iOS, which compiler is recommended?
Thanks,
-- Tito
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden