This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: RFC: TS 18661-3 and related floating-point interfaces
On Tue, 17 Jan 2017, Zack Weinberg wrote:
> On Tue, Jan 17, 2017 at 8:26 AM, Joseph Myers <joseph@codesourcery.com> wrote:
> > On Mon, 16 Jan 2017, Zack Weinberg wrote:
> >> > Any comments on this proposal regarding inclusion of TS 18661-3
> >> > functions and similar functions for the new types in glibc?
> >>
> >> New math functions should not set errno.
> >
> > New functions should set errno in accordance with the documented error
> > handling conventions and the value of math_errhandling
>
> ... which should be changed as necessary to reflect the principle that
> new math functions do not set errno. Math functions setting errno was
> a design mistake which should not be continued.
>
> If you disagree with this principle, please give a concrete reason
> _other than_ continuity.
I don't think it's a design mistake. It's the normal approach for
indicating errors in C library functions in glibc in general, and the only
way they can indicate errors when exceptions aren't supported. In the
limited number of cases where it's performance relevant, I'd also expect
the functions to be inlined by the compiler (taking due account of
-fno-math-errno), but there's the option of adding -fno-math-errno
versions of particular functions to glibc if considered valuable.
--
Joseph S. Myers
joseph@codesourcery.com