Re: Just starting off in obj C
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