[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
+    ++src;
+
+    if (result == ABS_MAX)
----------------
sivachandra wrote:
> 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.
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107999/new/
https://reviews.llvm.org/D107999
    
    
More information about the libc-commits
mailing list