[libc-commits] [libc] [libc] Use int in a64l instead of int32_t. (PR #150034)
Michael Jones via libc-commits
libc-commits at lists.llvm.org
Tue Jul 22 09:31:43 PDT 2025
================
@@ -44,10 +42,10 @@ constexpr static int32_t b64_char_to_int(char ch) {
LLVM_LIBC_FUNCTION(long, a64l, (const char *s)) {
// the standard says to only use up to 6 characters.
constexpr size_t MAX_LENGTH = 6;
- int32_t result = 0;
+ int result = 0;
----------------
michaelrj-google wrote:
standard says to use 32 bits, which is why I used int32 here: https://pubs.opengroup.org/onlinepubs/9799919799/functions/a64l.html
If int32 doesn't work I'd recommend `long` since that's the first type guaranteed to be at least 32 bits. You might have to mask it since `long` is often more than 32 bits.
https://github.com/llvm/llvm-project/pull/150034
More information about the libc-commits
mailing list