[fpc-devel] fpc and delphi applications cause floating point exceptions in other windows software :)

thaddy thaddy at thaddy.nl
Wed Jun 11 08:26:21 CEST 2008

Delphi has a utility routine for that. Set8087CW()
This is because some compilers, like gcc and microsoft do not stick to 
the intel specs and Delphi/BCC does.
With this controlword utility you can save and restore the FPU flags 
before and after intensive FPU operations.
They thought this the better option than "fix"something that wasn't 
really their bug....

Paul Ishenin wrote:
> Hello,  FPC developers' list.
> While implementing cursor support for gtk2 I noticed that lazarus 
> crashed every time with SIGFPE: division by zero in ICM32.dll if we 
> used GdkPixbuf as an image for the cursor. In that time I made a 
> woraround to use old gtk1 code for windows case (which used 
> GtkPixmap's for the same task).
> Now lazarus needs icon support and the same thing: when GdkPixbuf is 
> an icon image then we have SIGFPE: division by zero at the same dll.
> Ok, I searched the internet and found this gtk issue: 
> http://bugzilla.gnome.org/show_bug.cgi?id=316645 where ppl complained 
> about borland tools which incorrectly modifies CPU flags and this 
> cause crahes in other software (in that case GIMP).
> I've made a conclusion that I have the same issue but with FPC. I 
> disabled floating point exceptions before my gdk call and I see no 
> crash and working cursors and icons.
> I'm not skilled in compilers, CPUs and FPUs and I just want to ask you 
> if it is ok?
> -- 
> Best regards,
> Paul Ishenin.
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel
> ------------------------------------------------------------------------
> No virus found in this incoming message.
> Checked by AVG. 
> Version: 8.0.100 / Virus Database: 270.2.0/1495 - Release Date: 10/06/2008 17:11

More information about the fpc-devel mailing list