Mail Archives: djgpp/1998/05/25/04:29:01
Hello!
> > In fact, I prefer that the program terminate with a FP exception, so
> > that I am forced to fix the bug
>
> This option will always be there: just set up x87 to generate
> exceptions by calling `_control87' at the beginning of `main'.
>
> However, ANSI Standard specifically says that a program should NOT
> crash when exceptional numerical values are produced. So I think the
> *default* behavior cannot be to generate SIGFPE.
>
This may be a little bit off-topic (and to complicate to implement),
but for this problem (turning floating point exceptions on or off?)
I have a suggestion:
Would it be a possible (and good) sulution to switch on floating
point exceptions via linker flags?
On this machine I use floating exceptions normally turned off,
but you can tell the linker to enable them via the +FP option.
For example: +FPO turns on exceptions on floating point overflow,
+FPU on underflow, and so on.
The linker has to generate the appropriate startup code then.
Jens
--
| | | Jens Bischoff | Daimler-Benz Aerospace Airbus |
| --<O>-- +-----------------+---------------------------------+
| | | Aerodynamic Data Department (EFD) |
| Dasa Airbus | Huenefeldstrasse 1-5 D-28199 Bremen (Germany) |
- Raw text -