• 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
[Somewhat-OT] Unexpected behaviour of variable argument lists
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Somewhat-OT] Unexpected behaviour of variable argument lists


  • Subject: [Somewhat-OT] Unexpected behaviour of variable argument lists
  • From: j o a r <email@hidden>
  • Date: Thu, 16 Sep 2004 15:03:11 +0200

Consider the following log statement with an incorrect, or at least unusual, set of arguments:

	int someIntegerValue = 3;
	NSLog(@"A format string: %d" "Some other string", someIntegerValue);

I would have expected it to generate a compiler error, but for some reason it doesn't even log a warning. Also, it kind of "works" and outputs:

	A format string: 3Some other string

Apparently there is something I don't know or understand about what happens to arguments passed to a function/method that accept a variable number of arguments... Can someone please point me to the fine documentation?

j o a r

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: [Somewhat-OT] Unexpected behaviour of varia ble argument lists
      • From: Andréas Saudemont <email@hidden>
    • Re: [Somewhat-OT] Unexpected behaviour of variable argument lists
      • From: Ondra Cada <email@hidden>
    • Re: [Somewhat-OT] Unexpected behaviour of variable argument lists
      • From: Gwynne <email@hidden>
    • Re: [Somewhat-OT] Unexpected behaviour of variable argument lists
      • From: Tim Hart <email@hidden>
    • Re: [Somewhat-OT] Unexpected behaviour of variable argument lists
      • From: Allan Odgaard <email@hidden>
  • Prev by Date: Re: build numbers
  • Next by Date: Re: [Somewhat-OT] Unexpected behaviour of variable argument lists
  • Previous by thread: Re: Search LDAP directory using AddressBook API?
  • Next by thread: Re: [Somewhat-OT] Unexpected behaviour of variable argument lists
  • Index(es):
    • Date
    • Thread