[libc-commits] [libc] [libc] Fix size_t used without including stddef.h in CPP/limit.h. (PR #78861)
via libc-commits
libc-commits at lists.llvm.org
Sat Jan 20 13:10:03 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libc
Author: None (lntue)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/78861.diff
1 Files Affected:
- (modified) libc/src/__support/CPP/limits.h (+1-1)
``````````diff
diff --git a/libc/src/__support/CPP/limits.h b/libc/src/__support/CPP/limits.h
index e92ad00f80e037..d9e7090a0b7b19 100644
--- a/libc/src/__support/CPP/limits.h
+++ b/libc/src/__support/CPP/limits.h
@@ -20,7 +20,7 @@ namespace cpp {
// Some older gcc distributions don't define these for 32 bit targets.
#ifndef LLONG_MAX
-constexpr size_t LLONG_BIT_WIDTH = sizeof(long long) * 8;
+constexpr unsigned int LLONG_BIT_WIDTH = sizeof(long long) * 8;
constexpr long long LLONG_MAX = ~0LL ^ (1LL << (LLONG_BIT_WIDTH - 1));
constexpr long long LLONG_MIN = 1LL << (LLONG_BIT_WIDTH - 1);
constexpr unsigned long long ULLONG_MAX = ~0ULL;
``````````
</details>
https://github.com/llvm/llvm-project/pull/78861
More information about the libc-commits
mailing list