[Lazarus] FPC version 2.2.2 RC2 is out

Michael Van Canneyt michael.vancanneyt at wisa.be
Wed Jul 16 09:09:08 CEST 2008


Mattias Gaertner schreef:
> On Tue, 15 Jul 2008 15:51:42 +0200
> Ales Katona <almindor at gmail.com> wrote:
> 
>> I noticed you added a Set8087CW() to fix this problem, but it doesn't 
>> work for me, at least on amd64 with trackbar.
>>
>> I made a simple pure gtk+ C and pascal 1:1 program to test this and 
>> found out that setting $1332 or $133f doesn't help at all.
>>
>> Setting via math unit (SetExceptionMask(GetExceptionMask +
>> exZeroDivide) however does fix it. It's good enough to do this around
>> gtk_main() too it seems (for the trackbar at least).
>>
>> I think the best thing to do here is to use the Math unit functions
>> and Set/Unset the exZeroDivide mask before/after gtk_main.
>>
>> Again, the Set8087CW change didn't fix it on amd64/gtk2 (and possibly 
>> introduced various issues for math users).
> 
> Thanks for the hint.
> Changed in 15785.
>

Does ut turn of exception for divide by zero completely or just before 
calling gtk code? IOW, does the following code in a TButton.OnClick 
event handler show the message? If not, it might be worth to add this 
the list of 'incompatibilities'.

procedure TForm1.Button1Click(Sender: TObject);
var x, y, z: single;
begin
   x := 3.0; y := 1.0;
   try
     z := (x - y ) / (y - 1.0);
   except
     ShowMessage('Exception occurred');
   end;
end;

Vincent



More information about the Lazarus mailing list