| Issue |
74260
|
| Summary |
`libc/src/string/memory_utils/utils.h`: warning: implicit conversion loses integer precision: `unsigned long long` to `size_t`
|
| Labels |
libc
|
| Assignees |
|
| Reporter |
petrhosek
|
I'm seeing the following warnings when building libc for the baremetal riscv32 target:
```
In file included from /usr/local/google/home/phosek/llvm/llvm-project/libc/src/stdio/vsnprintf.cpp:12:
In file included from /usr/local/google/home/phosek/llvm/llvm-project/libc/src/stdio/printf_core/printf_main.h:13:
In file included from /usr/local/google/home/phosek/llvm/llvm-project/libc/src/stdio/printf_core/writer.h:15:
In file included from /usr/local/google/home/phosek/llvm/llvm-project/libc/src/string/memory_utils/inline_memcpy.h:14:
/usr/local/google/home/phosek/llvm/llvm-project/libc/src/string/memory_utils/utils.h:50:36: warning: implicit conversion loses integer precision: 'unsigned long long' to 'size_t' (aka 'unsigned int') [-Wshorten-64-to-32]
50 | return value == 0 ? value : 1ULL << log2s(value);
| ~~~~~~ ~~~~~^~~~~~~~~~~~~~~
/usr/local/google/home/phosek/llvm/llvm-project/libc/src/string/memory_utils/utils.h:56:50: warning: implicit conversion loses integer precision: 'unsigned long long' to 'size_t' (aka 'unsigned int') [-Wshorten-64-to-32]
56 | return is_power2_or_zero(value) ? value : 1ULL << (log2s(value) + 1);
| ~~~~~~ ~~~~~^~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs