summaryrefslogtreecommitdiff
path: root/libc/src/stdlib/atoi.cpp
AgeCommit message (Collapse)Author
2025-06-11[libc] Move libc_errno.h to libc/src/__support and make ↵lntue
LIBC_ERRNO_MODE_SYSTEM to be header-only. (#143187) This is the first step in preparation for: https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2024-07-12[libc] Migrate to using LIBC_NAMESPACE_DECL for namespace declaration (#98597)Petr Hosek
This is a part of #97655.
2024-07-12Revert "[libc] Migrate to using LIBC_NAMESPACE_DECL for namespace ↵Mehdi Amini
declaration" (#98593) Reverts llvm/llvm-project#98075 bots are broken
2024-07-11[libc] Migrate to using LIBC_NAMESPACE_DECL for namespace declaration (#98075)Petr Hosek
This is a part of #97655.
2023-09-26[libc] Mass replace enclosing namespace (#67032)Guillaume Chatelet
This is step 4 of https://discourse.llvm.org/t/rfc-customizable-namespace-to-allow-testing-the-libc-when-the-system-libc-is-also-llvms-libc/73079
2023-03-03[libc] move stdlib and stdio to new errno patternMichael Jones
Fixes https://github.com/llvm/llvm-project/issues/61071 Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D145191
2022-12-20[libc][NFC] make atoi undefined cases match stdMichael Jones
The standard describes atoi as: "equivalent to atoi: (int)strtol(nptr, (char **)NULL, 10)" Previously, our behavior was slightly different on numbers larger than INT_MAX, but this patch changes it to just do the cast instead. Both of these are valid since the standard says "If the value of the result cannot be represented, the behavior is undefined." But matching existing behavior makes differential fuzzing easier. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D140350
2022-12-09[libc] add result class to strtointegerMichael Jones
This is a class intended to improve errno handling for internal functions by allowing functions to return their result and error status instead of setting errno. This specific class will be used for strtointeger and (in a followup patch) strtofloat. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D133163
2021-11-03[libc][NFC] rename str_conv_utils to str_to_integerMichael Jones
rename str_conv_utils to str_to_integer to be more in line with str_to_float. Reviewed By: sivachandra, lntue Differential Revision: https://reviews.llvm.org/D113061
2021-08-19[libc] add atoi, atol, and atollMichael Jones
This is based on the work done to add strtoll and the other strto functions. The atoi functions also were added to stdc and entrypoints.txt. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D108330