Darren New <dne### [at] sanrrcom> wrote:
> That doesn't mean it's a *good* thing.
Nobody claimed it is. It's just something you have to live with if you
program in C (or its close variants).
> The problem is that composing two perfectly valid statements makes an
> invalid program that behaves completely differently than how you would
> expect from each of those two statements separately.
But you *can't* expect something specific to happen if you dereference
null (even if you do it "separately"). If you dereference null, *anything*
can happen (including the following code doing something completely different
than what you expect).
If you want derefercing null to do something special (which cannot be
written in C itself), you'll have to use some custom extension of the
programming language.
--
- Warp
Post a reply to this message
|