Floatting point exception manager.

Wolfers Pierre wolfers@labs.polycnrs-gre.fr
Thu Oct 8 13:47:00 GMT 1998


    I am a user of gcc in (in C language) in the cygwin32 + egcs
environment with the operating system Windows NT 4, I use also gcc on
the O.S. Linux Red-Hat 5.0
    I wrote an Object Pascal compiler (in Pascal) which produce a C
code  to be portable. This Pascal is used by some cristallographic
packages (research activity) in my laboratory (Laboratoire de
Cristallographie de Grenoble (France, Centre de la Recherche
scientifique)). We can run the resulting program on the following
systems:  DEC OPENVMS (VAX and ALPHA), DEC UNIX-OSF/1, HP-UX 9, IRIX of
Silicon-Graphic, LINUX and Windows 95/NT with Cygwin32.
    Any floatting point Overflow or ZeroDivide, have no effect on the
program flow (No interrupt) and the IEEE result value is infinite. This
behaviour is not convenient for a correct scientific program that must
detect any floatting error that can occur during a fit (no convergence)
or with bad data values. Your fortran g77 has the same problem (I
believe that the standard  Fortran behaviour is : Output a message and
continue, with a maximum error count before stop).
    I use the "signal(SIGFPE, handler);" C statement that give a correct
result with VMS but not in Linux, HPUX or cygwin32/Windows. It seems
that the POSIX standard do not defines a standard managment of floatting
point trap. I would like to know a method to get interrupt control in my
code.

    Except my problem, Cygwin32 with egcs are marvellous products,
thanks for all.

                                                        Yours sincerely,

                                                        Pierre Wolfers

wolfers@grxtal.polycnrs-gre.fr
                                                        Laboratoire de
Cristallographie
                                                        BP 166
                                                        F 38042 GRENOBLE
CEDEX, FRANCE





More information about the Gcc-bugs mailing list