On Mon, 4 Jan 2010, Stefan Kisdaroczi wrote:

hi list,

the code below compiled and worked with fpc 2.2.x.
With fpc 2.4.0 compilation fails with "Division by zero".

---- 8< ----
program divsucc;

begin
 writeln( 256 DIV succ(255) );
end.

Well, Succ(255) is probably evaluated as a byte, in which case it is zero,
and then when attempting to evaluate the DIV, the compiler indeed tries to divide by zero.

I don't know whether the behaviour of the compiler changed in this respect,
but it seems so ?

Michael.
_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to