[fpc-devel] Typed addresses by default

Vincent Snijders vsnijders at quicknet.nl
Thu Oct 5 15:11:47 CEST 2006


Micha Nelissen wrote:
> 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;

This only compiles without errors if Low(T)=0.

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

Vincent



More information about the fpc-devel mailing list