[fpc-pascal] Weird string behavior

Michael Van Canneyt michael at freepascal.org
Tue Jul 26 16:19:27 CEST 2016



On Tue, 26 Jul 2016, Santiago A. wrote:

> El 26/07/2016 a las 12:27, Mattias Gaertner escribió:
>> a3:=a1+a2 => cp = 1252
>> a3:=a2+a1 => cp = 65001
> Is that the expected behavior?
>
> IMHO the result should be the same. And the only way is to make it
> depend on a3, no matter what is in the left side. That's the way things
> are done in Pascal

This is not correct. In pascal the right-hand side of an assignment has a well-defined type. 
The compiler checks whether the type on the right is assignment-compatible to the left side.

Michael.


More information about the fpc-pascal mailing list