This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Don't treat rint as setting errno
- From: Bernd Schmidt <bschmidt at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org, richard dot sandiford at arm dot com
- Date: Fri, 6 Nov 2015 16:17:08 +0100
- Subject: Re: Don't treat rint as setting errno
- Authentication-results: sourceware.org; auth=none
- References: <87egg3tbm5 dot fsf at e105548-lin dot cambridge dot arm dot com>
On 11/06/2015 04:02 PM, Richard Sandiford wrote:
builtins.def says that rint sets errno, but it looks like this might
be a mistake. C99 says that rint doesn't set errno and the builtins.c
expansion code doesn't try to keep errno up to date.
[snip explanation of the history]
FWIW the manpage has this to say:
"SUSv2 and POSIX.1-2001 contain text about overflow (which might set
errno to ERANGE, or raise an FE_OVERFLOW exception). In practice, the
result cannot overflow on any current machine, so this error-handling
stuff is just nonsense."
Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.
OK to install?
Ok.
Bernd