Re: Is there a more efficient way to get the first 4 bytes off a NSInputStream to compare
Re: Is there a more efficient way to get the first 4 bytes off a NSInputStream to compare
- Subject: Re: Is there a more efficient way to get the first 4 bytes off a NSInputStream to compare
- From: Jeremy Pereira <email@hidden>
- Date: Wed, 28 Jan 2009 17:43:20 +0000
On 28 Jan 2009, at 17:08, Michael Ash wrote:
On Wed, Jan 28, 2009 at 6:00 AM, Jeremy Pereira <email@hidden>
wrote:
On 27 Jan 2009, at 23:07, Graham Cox wrote:
However, I would argue that this is the C compiler behaving in a
deliberately inconsistent way, since in C, arrays and pointers are
supposed
to be the same thing. As buffer is actually a constant, taking its
address
should really result in a compiler error in the same way as int a =
&123;
It's not the C compiler, it's the language. This behavior is required
by the language specification, so the compiler can't help but comply.
If you want to be pedantic, it is the compiler doing the behaving,
it's the compiler doing the compiling, not the language specification.
I put the word "deliberately" in to indicate that it is in accordance
with the spec. Had I thought it not in accordance with the
specification, I would have used the word "bug".
Now we can talk all we want about how these things "should" work, and
I agree that this behavior can be kind of odd, but the fact is that
it's a part of the language, a part of the standard, it is how it is,
and it's not going to be changed.
You don't have to accept something as sensible just because it is in a
specification. You do, of course, have to put up with it, unless you
have enough influence to get the specification changed.
_______________________________________________
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