On Mon, 18 Jun 2018, Jeff Law wrote: > So do we need to set or check math_errhandling & MATH_ERRNO at all? Or
That's a matter for libc (glibc currently sets it based on __FAST_MATH__ / __NO_MATH_ERRNO__, but fails to avoid including MATH_ERREXCEPT in the definition for configurations not supporting exceptions). > WRT library behavior, I thought it was only complex arithmetic that had > the option of setting errno. I thought float/double math functions had > a requirement to set errno? For complex.h functions it's always optional. For math.h functions at least one of errno and exceptions must be set, as indicated in the definition of math_errhandling (and if math_errhandling is defined to just one of MATH_ERRNO and MATH_ERREXCEPT, functions then may or may not also indicate errors in the other way). Hence the question of whether a -fno-math-errno default should be different for (mainly soft-float) configurations not supporting floating-point exceptions, for which errno is the only way they have available to indicate errors. -- Joseph S. Myers jos...@codesourcery.com