diff options
author | cor3ntin <corentinjabot@gmail.com> | 2025-05-15 18:16:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-15 18:16:05 +0200 |
commit | 381a649fb991eadb0c594de2d8b6166fcc11345a (patch) | |
tree | 43cdf12a5413cd76e91ff4ea70f058436c6f5c23 /llvm/tools/llvm-objdump/llvm-objdump.cpp | |
parent | 540cf25a6df56fa1810a7411477dca9896aeed20 (diff) | |
download | llvm-381a649fb991eadb0c594de2d8b6166fcc11345a.zip llvm-381a649fb991eadb0c594de2d8b6166fcc11345a.tar.gz llvm-381a649fb991eadb0c594de2d8b6166fcc11345a.tar.bz2 |
[Clang] Add warnings when mixing different charN_t types (#138708)
charN_t represent code units of different UTF encodings. Therefore the
values of 2 different charN_t objects do not represent the same
characters.
In order to avoid comparing apples and oranges, we add new warnings to
warn on:
- Implicit conversions
- Comparisons
- Other cases involving arithmetic conversions
We only produce the warning if we cannot establish the comparison would
be safe through constant evaluation.
The new `-Wimplicit-unicode-conversion` warning is enabled by default.
Note that this PR intentionally doesn;t touches char/wchar_t, but it
would be worth considering also warning on extending the new warnings to
these types (in a follow up)
Additionally most arithmetic operations on charN_t don't really make
sense (ie what does it mean to addition code units), so we could add
warnings for that.
Fixes #138526
Diffstat (limited to 'llvm/tools/llvm-objdump/llvm-objdump.cpp')
0 files changed, 0 insertions, 0 deletions