>What do you call observable?

C has a pretty exact definition of this.

>Replacing the content of a memory region by a constant value is
>an observable effect by itself.

No, it's not.  Where did you _get_ the address to observe?
That's the essence of the observability question.

The C compiler knows that globals are observable outside of
the scope it is generating code for.  But auto variables
are not.  Likewise heap variables, if it knows that the scope
of the _address_ (malloc return value) never leaves the building,
so to speak.

Taking your argument to a ridiculous level, should the compiler
be _forbidden_ to keep variables in address-less machine registers
_unless_ you used the register keyword?  It's all the same thing,
really.  Lifetime, scope, and observability: the essential trinity...

(The TI 9900 is the only machine I know of where you would
 be able to take the address of a 'register' variable, for real,
 but the definition of C prohibits this.  Perhaps a C compiler
 for a 6502 could do the same, but only because it doesn't _have_
 any registers so far as C is concerned; that keyword could be
 ignored.)

-- Jim

_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to