This is an archive of the discontinued LLVM Phabricator instance.

[libc] tweak strtof errno behavior
ClosedPublic

Authored by michaelrj on Nov 10 2021, 4:30 PM.

Details

Summary

When strtof/d/ld return a subnormal number they may set errno to
ERANGE. This change makes this behavior more consistent by making any
decimal number converting to a subnormal set errno to ERANGE. This
brings it in line with hexadecimals, which currently only set errno to
ERANGE if the number is truncated when converting to a subnormal.

Diff Detail

Event Timeline

michaelrj created this revision.Nov 10 2021, 4:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 10 2021, 4:30 PM
michaelrj requested review of this revision.Nov 10 2021, 4:30 PM
lntue accepted this revision.Nov 10 2021, 6:30 PM
This revision is now accepted and ready to land.Nov 10 2021, 6:30 PM
sivachandra accepted this revision.Nov 10 2021, 8:34 PM
This revision was automatically updated to reflect the committed changes.