[libc-commits] [libc] [libc] Fix definition of `UINT_MAX` in limits.h (PR #95279)

via libc-commits libc-commits at lists.llvm.org
Wed Jun 12 10:56:56 PDT 2024


================
@@ -148,7 +148,7 @@
 #endif // INT_MAX
 
 #ifndef UINT_MAX
-#define UINT_MAX (~0U)
+#define UINT_MAX (INT_MAX * 2U + 1U)
----------------
lntue wrote:

shall we explicitly cast `((unsigned) INT_MAX)`?

https://github.com/llvm/llvm-project/pull/95279


More information about the libc-commits mailing list