I'm using gfortran for some code. For a while now, I've been compiling with
-ffpe-trap=zero,overflow,invalid
in an attempt to hunt down some bugs. This causes my program to cease execution immediately. There are some cases where the FPE might be OK and so a flag like:
-ffpe-warn=zero,overflow,invalid
would be very useful. Does gfortran (or any other compiler) provide anything like this? If not, are there any workarounds? My current thought is to create a C function to register a signal handler to write out the warning, although I have no idea how to go about doing that.