El 27/12/2016 a las 12:26, Chavoux Luyt via Lazarus escribió:
Hi,

I wrote a small program for Linux in a previous version of Lazarus which
compiled and ran without problems before. I have now updated to fpc
3.0.0 and Lazarus 1.6 (backports version for Debian X86_64 Jessie). The
code still compiles perfectly (it had a number of warnings, but these
have now disappeared: e.g. unixfileutil.inc(6,51) Warning: Symbol
"UTF8ToSys" is deprecated: "Use the function in LazUTF8 unit"), but it
results in a runtime error
"Project birds raised exception class 'External: SIGFPE'.

 At address 7FFFEF8FC57F"

when running the following code:
procedure THoofVrm.OpenBtnClick(Sender: TObject);
begin
  OpenDlg.Execute;
end;

What is wrong with my code (and how should I change it)?


Hello,

Probably nothing wrong by your side, try to disable math exceptions before the call to .execute and reenable after it (C code does not trap math exceptions).

uses math;

var
  oldexcept: TFPUExceptionMask;

oldexcept := SetExceptionMask([exInvalidOp, exDenormalized, exZeroDivide, exOverflow, exUnderflow, exPrecision]);

OpenDlg.execute;

SetExceptionMask(oldexcept);

--

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus-ide.org/listinfo/lazarus

Reply via email to