This is the mail archive of the
mailing list for the GCC project.
Re: [RFC Patch]: Implement remainder() as built-in function [PR fortran/24518]
On Mon, 23 Oct 2006, Richard Guenther wrote:
> I wonder how we want to deal with the errno mess in general here. The C
> standard actually most of the time allows setting errno but does not
> require it (like for fmod - sqrt is an exception to this) and glibc for
> example does never set errno in these cases. I understand that the
> ideal semantics of -fno-math-errno is to match the installed library,
> but inserting library calls is costly and may not even be possible (like
> for lrint, where a check for NaN is not possible).
In some cases, allowing errno not to be set is an incompatible quiet
change in C99; in C90, if domain errors or overflow range errors occur,
errno must be set (but in some cases it's not specified whether such
errors occur, and of course this only applies to functions defined by
If !flag_isoc99, this means that in some cases errno is required to be
set. If flag_isoc99, GCC and libc should cooperate to get the right
setting of math_errhandling (with math_errhandling & MATH_ERRNO set if all
translation units were compiled with errno setting enabled).
Joseph S. Myers