Re: Just starting off in obj C
Re: Just starting off in obj C
- Subject: Re: Just starting off in obj C
- From: Chris Idou <email@hidden>
- Date: Sat, 25 Oct 2008 05:02:25 -0700 (PDT)
--- On Fri, 10/24/08, Bill Bumgarner <email@hidden> wrote:
> NSLog simply doesn't check its arguments. It is a bug.
> Or, not a
> bug, it is simply a feature not yet implemented.
Ahh yes, but format specifications are not part of the language, they are part of the library, and thus its not really part of the compiler's job to check them. That some compilers do check them is quite an ugly hack, rather than a defence of the language. It's putting a special case in the compiler, that the compiler can't check as a general case. If one was designing a safe language then variable argument functions would be able to report how many arguments were passed to it without resort to nil terminators, format strings and other brittle mechanisms.
> As for brittleness, yup -- C *can* be brittle if you abuse
> typecasting
> and ignore compiler warnings.
I have to disagree, C is by its nature fairly brittle. Uninitialized pointers, buffer overruns, untyped pointers, varargs functions, memory management... there's a lot of ways to blow up a program that can't happen in other languages.
_______________________________________________
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