[fpc-pascal] IE 200307043

John Coppens john at jcoppens.com
Mon May 25 23:35:27 CEST 2009


On Mon, 25 May 2009 21:09:44 +0000
Prince Riley <wmarketing3 at gmail.com> wrote:

> Type checking for valid
> pointer arithmetic and the difference between a 'null' or empty pointer
> and one that has the lowest value of it's type.

Maybe the use of 'nil' in an expression should not be allowed at all
(except comparisons). 

As I understand its meaning is that it sets (any) pointer to an invalid
value. But I seem to have read that in case of microcontrollers 'NULL' at
times means $FFFF, and, according to Wikipedia, some computers assign the
max negative value to NULL:

http://en.wikipedia.org/wiki/Null_(computer_programming)

So, any reliance on nil being 0 (or any definite value) would seem
unreliable (sorry for the pun).

Taking this further, nil = prt(0, 0) shouldn't be true (though in most
programming languages they are equivalent, and in case of a PC-like
environment it's complicated to represent a really 'invalid' scalar
value).

John



More information about the fpc-pascal mailing list