[libc-commits] [PATCH] D107999: [libc] Add strtol, strtoul, and strtoull
Michael Jones via Phabricator via libc-commits
libc-commits at lists.llvm.org
Tue Aug 17 10:37:16 PDT 2021
michaelrj added inline comments.
Comment at: libc/src/__support/str_conv_utils.h:94
+ if (result == ABS_MAX)
> Add a comment here explaining the early return; point out that we read out the full number even if it is out of range.
I did that, in addition I added setting errno, since it's possible to hit ABS_MAX exactly, and then have more numbers. With the code as it was previously that would not set ERANGE in that case. I've added a test to `strtoll_test.cpp` to handle that.
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
More information about the libc-commits