[fpc-pascal] chr does not return an error when number bigger then byte enters
Jonas Maebe
jonas.maebe at elis.ugent.be
Wed Nov 14 17:47:12 CET 2012
On 14 Nov 2012, at 17:33, ik wrote:
> begin
> writeln(chr(256)); // because it is constant, the compiler only yell warning
> end.
>
> Why does FPC allow such value to enter chr without raising something up ?
You can get an error by enabling range checking (-Cr on the command line or {$r+} in the source code).
Jonas
More information about the fpc-pascal
mailing list