• 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
Why is 'missing sentinel in function call' appearing?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Why is 'missing sentinel in function call' appearing?
      • From: Greg Parker <email@hidden>
    • Re: Why is 'missing sentinel in function call' appearing?
      • From: David Duncan <email@hidden>
  • Prev by Date: Re: Missing something with CGColorGetComponents()
  • Next by Date: Re: Why is 'missing sentinel in function call' appearing?
  • Previous by thread: Re: Missing something with CGColorGetComponents()
  • Next by thread: Re: Why is 'missing sentinel in function call' appearing?
  • Index(es):
    • Date
    • Thread