[fpc-pascal] NULL pointer to array of integer

Jonas Maebe jonas.maebe at elis.ugent.be
Wed Sep 13 20:10:00 CEST 2006


On 13 Sep 2006, at 19:39, Vinzent Höfler wrote:

>>  In FPC, nil = pointer(0) on all currently supported platforms,  
>> but in
>>  principle it could be anything.
>
> I'm making enemies now,

Where?

> 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.

I don't see why, except for compatibility with code built on wrong  
assumptions. However, for exactly that same reason nil is unlikely to  
ever become something different from pointer(0) in FPC.

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

Does it guarantee that (void*)(0) == NULL?


Jonas


More information about the fpc-pascal mailing list