[fpc-devel] Typed addresses by default

Micha Nelissen micha at neli.hopto.org
Thu Oct 5 14:52:04 CEST 2006


Ivo Steinmann wrote:
> Well, it's a good idea to enable typed addresses by default, but I have 
> got one problem with that. The pointer to an array of a type should be 
> allowed to assign to the pointer of the same type.
> 
> Example
> 
> T: array[-10..10] of Integer;
> P: PInteger;
> 
> I request that "P := @T;" should be allowed, because a pointer type in 
> objfpc mode are also treated as pointer to an array of that type, that 
> means  P[...] is allways allowed also.

Just a note, there will be 3 ways to write the same thing then:

P := T;
P := @T;
P := @T[Low(T)];

A bit odd, no ? Although in all cases it's quite clear what is meant, 
but I don't know if this "scales" to more complex expressions ?

Micha



More information about the fpc-devel mailing list