Mail Archives: djgpp/1993/01/14/10:57:46
The following program is compiled with
gcc fptest.c -Wall -lm -m486 -O
and runs without printing any message about its two floating point
execptions:
/* this is a floating point test */
#include <math.h>
int main(void)
{
double
w,
x,
y = 1.0,
z = 0.0,
t = -1.0;
w = y/z ;
x = log(t) ;
return 0 ;
}
I would like to know how to:
1) trap the exceptions and stop the program as soon as one occurs,
à la FORTRAN;
2) if possible at all, print the function and the line in which
the exception occurred.
Any suggestions will be appreciated.
Nelson Luis Dias
ae2y AT vax5 DOT cit DOT cornell DOT edu
- Raw text -