[libc-commits] [libc] [libc] Add `-Wsign-conversion` & un-reverts `-Wconversion` (PR #129811)

Vinay Deshmukh via libc-commits libc-commits at lists.llvm.org
Fri Mar 7 03:40:56 PST 2025


================
@@ -296,7 +296,7 @@ LIBC_INLINE constexpr cpp::array<word, N> shift(cpp::array<word, N> array,
   for (size_t index = 0; index < N; ++index) {
     const word part1 = safe_get_at(index + index_offset);
     const word part2 = safe_get_at(index + index_offset + 1);
-    word &dst = out[at(index)];
+    word &dst = out[static_cast<size_t>(at(index))];
----------------
vinay-deshmukh wrote:

`decltype(at(...))` is int`, but `operator[]` needs `size_t`

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


More information about the libc-commits mailing list