This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH][BZ #6803] Set errno for scalbln, scalbn
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Stefan Liebler <stli at linux dot vnet dot ibm dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Fri, 25 Apr 2014 14:35:12 +0000
- Subject: Re: [PATCH][BZ #6803] Set errno for scalbln, scalbn
- Authentication-results: sourceware.org; auth=none
- References: <lj8io2$hgi$1 at ger dot gmane dot org>
On Wed, 23 Apr 2014, Stefan Liebler wrote:
> Hi,
>
> this patch sets errno to ERANGE on overflow and underflow.
> The corresponding tests in libm-test.inc are updated to check for errno, too.
>
> Tested on S390/S390x.
>
> ok to commit?
I don't think this is the best approach. Apart from needing lots of
architecture-specific versions updated (so you'd need to draw the
attention of relevant architecture maintainers to the issue), we already
have a scalbn wrapper that checks for overflow/underflow and sets errno,
in the form of ldexp. So for scalbn it would be most natural to make
scalbn an alias for __ldexp instead of __scalbn; for scalbln you'd need to
add a new wrapper, replacing scalbln being an alias for __scalbln.
(The tests will then need to use ERRNO_PLUS_OFLOW etc. so the expectations
only cover the cases where glibc guarantees errno setting.)
--
Joseph S. Myers
joseph@codesourcery.com