• 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: Just starting off in obj C
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Just starting off in obj C


  • Subject: Re: Just starting off in obj C
  • From: "Clark Cox" <email@hidden>
  • Date: Sun, 26 Oct 2008 09:11:12 -0700

On Sat, Oct 25, 2008 at 9:27 PM, Chris Idou <email@hidden> wrote:
> --- On Sat, 10/25/08, Bill Bumgarner <email@hidden> wrote:
>> From: Bill Bumgarner <email@hidden>
>> Actually, the C standard encompasses both the C language
>> and the C runtime library, libC.   libC includes printf style
>> formatting functions and, as such, the spec contains very exact
>> descriptions of the formatting string behavior therein.
>
> Which doesn't actually solve everything. For example, it would be quite a common thing in C to write a log() function that is implemented via vsprintf and family, so that you are passing format strings and arguments to functions other than the raw fprintf and family functions, in which case you are out of luck for compiler type checking.

FYI: At least with GCC, you are not out of luck; GCC allows one to
mark functions as "printf-like" for the purposes of format string type
checking:

void my_printf(const char *format, ...) __attribute__((format(printf, 1, 2)));

Now, GCC will check calls to my_printf in the same way as it checks
calls to printf.

--
Clark S. Cox III
email@hidden
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: Just starting off in obj C (From: Bill Bumgarner <email@hidden>)
 >Re: Just starting off in obj C (From: Chris Idou <email@hidden>)

  • Prev by Date: Re: Project Find - Replace Fails Silently - Watch Movie!
  • Next by Date: Re: Equivalent to xcconfig conditionals available?
  • Previous by thread: Re: Just starting off in obj C
  • Next by thread: Re: Just starting off in obj C
  • Index(es):
    • Date
    • Thread