[fpc-pascal] FPU Configuration inside a library

Adrian Veith adrian at veith-system.de
Tue Sep 25 12:19:13 CEST 2007


i posted this already under a differnt subject, but didn't get a feedback.

A .dll written in fpc changes the configuration of the FPU (FPUCW). This 
might cause a strange behavior inside the loading program.

If the loading program allows division by zero (1.0 / 0.0), it will 
crash after the .dll written in freepascal is loaded. What is really bad 
with this is, that the crash occurs at total different place and time 
inside the loading program (very hard to find).

The initialization of fpc should only change the FPU configuration 
inside a program not inside a library.

IMHO same should be true with other settings like LOCALE settings.


fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org

More information about the fpc-pascal mailing list