Jonas Maebe wrote:

On 13 Sep 2006, at 14:00, Eduardo wrote:

I remember that on c a null pointer has value 0, but in ansi pascal it has value 23.
>
The value of nil is not defined in the ISO Ansi Pascal standard.

Neither it is in any official C standard.

> In FPC, nil = pointer(0) on all currently supported platforms, but in
> principle it could be anything.

I'm making enemies now, but:

If the NIL pointer is represented by another value (like 0xFFFFF780 or such) on a given target platform, the integer conversion from a _compile-time_ constant 0 literal should still lead to a NIL representation.

Basically that would be the same behaviour as what the C-standard guarantees.

Note that this leads to a subtle difference on such platforms between integer literals whether they're known at compile or at runtime.



Vinzent.

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to