Den 07-11-2012 00:12, Andrew skrev:
On 12-11-06 05:07 PM, Michael Van Canneyt wrote:

Please re-open the issue and I will post an updated program that fails EVERY TIME.

Or just use the attached Widen.lpr... :-)
Try this
FSize:=int64(1024*1024*1024)*Factor;

1024*1024*1024 is handled as a longint on a 32bit machine. Multiplied by a byte will still give a longint, which will overflow if multiplied by 2.

It also generates a hint about that:
widen.lpr(44,12) Hint: Converting the operands to "Int64" before doing the multiply could prevent overflow errors.
_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to