[clang-tools-extra] [clang-tidy] Create a check for signed and unsigned integers comparison (PR #113144)

Julian Schmidt via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 21 16:41:40 PST 2024


https://github.com/5chmidti requested changes to this pull request.

The check will currently not flag the use of literals like so:

```c++
void foo(unsigned short *uArray){
    uArray[0] <= 10;
}
```
https://godbolt.org/z/a6W9xGcMY

because they do not contain an implicit cast. Only one of the two operands needs to have an implicit cast to the other operands type for the comparison to be a potential issue.


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


More information about the cfe-commits mailing list