gfortran IEEE exception inexact

后端 未结 1 732
栀梦
栀梦 2020-12-21 13:49

We are using gfortran (5.3.1), Fedora 23, in a new 64 b machine. Compiling with simple gfortran -o (we are not using -ffpe-trap options !), excites the \"classical- trivial\

相关标签:
1条回答
  • 2020-12-21 14:36

    As per https://gcc.gnu.org/ml/fortran/2013-06/msg00072.html the Fortran standard requires printing of these notes after executing the STOP statement.

    "If any exception (14) is signaling on that image, the processor shall issue a warning indicating which exceptions are signaling; this warning shall be on the unit identified by the named constant ERROR UNIT (13.8.2.8)."

    Note that even if you request the Fortran 95 standard by -std=f95 the note is still displayed.

    You can control this behaviour by -ffpe-summary=, consult you compiler's manual. By default, a summary for all exceptions but ‘inexact’ is shown. Have you enabled inexact yourself somewhere?

    Why is that exception signalling is a different matter, you must examine your code whether it is something you should be worried about or not. Probably you should not, inexact floating point operations are very common.

    Because the message is invoked by the STOP statement, a simple way to get rid of these messages is to not terminate your program by a STOP statement, but let it reach the END PROGRAM.

    0 讨论(0)
提交回复
热议问题