[clang] Address a handful of C4146 compiler warnings where literals can be replaced with std::numeric_limits (PR #147623)
Owen Pan via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 8 18:18:41 PDT 2025
================
@@ -777,7 +779,7 @@ template <> struct MappingTraits<FormatStyle::SpacesInLineComment> {
IO.mapOptional("Maximum", signedMaximum);
Space.Maximum = static_cast<unsigned>(signedMaximum);
- if (Space.Maximum != -1u)
+ if (Space.Maximum != std::numeric_limits<unsigned>::max())
----------------
owenca wrote:
```suggestion
if (Space.Maximum < UINT_MAX)
```
as that's what's used elsewhere in the file.
https://github.com/llvm/llvm-project/pull/147623
More information about the cfe-commits
mailing list