• 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
Re: Crash when calling va_arg()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Crash when calling va_arg()


  • Subject: Re: Crash when calling va_arg()
  • From: Jens Alfke <email@hidden>
  • Date: Wed, 04 Jul 2012 16:43:08 -0700

On Jul 4, 2012, at 4:30 PM, Tito Ciuro wrote:

> This allows it to work without crashing, but I'd like if possible to avoid having to place the sentinel. Any ideas?

There's no way around this, other than perhaps passing in the number of variable arguments as an explicit parameter. The C calling conventions don't allow a function to detect how many arguments it has, or where the argument list ends in the stack. So va_arg() can't magically return NULL at the end of the argument list, as your code expects it to.

—Jens
_______________________________________________

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


References: 
 >Crash when calling va_arg() (From: Tito Ciuro <email@hidden>)

  • Prev by Date: Crash when calling va_arg()
  • Next by Date: Re: Crash when calling va_arg()
  • Previous by thread: Crash when calling va_arg()
  • Next by thread: Re: Crash when calling va_arg()
  • Index(es):
    • Date
    • Thread