This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][BZ #6803] Set errno for scalbln, scalbn


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]