[fpc-pascal] paszlib problem: integer overflow
Marco van de Voort
marcov at stack.nl
Thu Nov 14 15:43:07 CET 2013
In our previous episode, Dennis Poon said:
> Dennis Poon wrote:
> > I downloaded the Paszlib-sg from
> > http://sagsehome.net/oss/paszlib-sg.php (as suggested by Paszlib
> > freepascal.org wiki).
No. It doesn't suggest that. It says that code in FPC originally came from
the same sources as that. But paszlib in FPC has had bugfixes.
> > I works fine on my Delphi 5 until I try to compress a file with size
> > of 70M and it raises the exception of integer flow error.
That means you enabled that somehow. Integer under/overflow is generally not
enabled by default, and it is somewhat unlogical to use it with converted C
> > I initially thought it might be a Delphi 5 problem so I tried to use
> > Lazarus with fpc 2.6.2 to compile the same problem but it kept
> > complaining cannot find zstream although I already add FCL package to
> > the required packages list.
Probably cause by providing external paszlib sources, in combination with
precompiled already there paszlib sources, the compiler gets confused what
depends on what.
Forget about the -sg code for Lazarus, simply use the FPC provided one only.
Turn off the range checks, and try again.
More information about the fpc-pascal