Message-Id: <9805250826.AA23178@axe.bre.da> Subject: Re: Code to Fix sinh() in libm.a / Floating Exceptions To: eliz AT is DOT elta DOT co DOT il (Eli Zaretskii) Date: Mon, 25 May 1998 10:26:52 METDST Cc: djgpp AT delorie DOT com In-Reply-To: ; from "Eli Zaretskii" at May 24, 98 7:36 pm From: Jens Bischoff Precedence: bulk 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 | | ---- +-----------------+---------------------------------+ | | | Aerodynamic Data Department (EFD) | | Dasa Airbus | Huenefeldstrasse 1-5 D-28199 Bremen (Germany) |