zygoloid wrote: I don't think this type-based approach is the right choice. It will lead to a lot of false negatives, and I'm especially concerned that this patch is also dropping warnings for comparisons that just happen to be the same type as `size_t` (eg, direct use of `unsigned long` or `uint64_t`).
It would seem reasonable to suppress the warning for comparisons where one of the operands is specifically `sizeof(T)` (or a simple arithmetic computation involving `sizeof(T)` such as `sizeof(T) + k` or `k * sizeof(T)`). https://github.com/llvm/llvm-project/pull/74427 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits