Test errno setting on strtod overflow in tst-strtod-round
Zack Weinberg
zack@owlfolio.org
Wed Aug 14 18:10:01 GMT 2024
On Wed, Aug 14, 2024, at 1:51 PM, Joseph Myers wrote:
> On Wed, 14 Aug 2024, Zack Weinberg wrote:
>> On Tue, Aug 13, 2024, at 1:52 PM, Joseph Myers wrote:
>> > We have no tests that errno is set to ERANGE on overflow of strtod-
>> > family functions (we do have some tests for underflow, in tst-strtod-
>> > underflow). Add such tests to tst-strtod-round.
>>
>> Maybe we should also have tests that errno is left unchanged by these
>> functions if no overflow or underflow occurred? (I don't know if
>> these already exist.)
>
> The difficulty there is the details of "no underflow". We do have tst-strtod-
> underflow that checks this for various edge cases of underflow (for
> double, I intend to extend it to cover other types as well). We also
> have bug 32045 which notes we wrongly set errno for overflow in
> parsing a NaN payload.
I think the most valuable thing would be to check for unchanged errno
after parsing each of some uniformly distributed random sample of normal
numbers. Further, exploring the space of valid input strings is probably
more useful than exploring the space of normal-number return values, if
that makes sense?
zw
More information about the Libc-alpha
mailing list