[clang] [sema] Improve -Wsign-compare (PR #65684)

via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 8 00:34:53 PDT 2023


cor3ntin wrote:

Thanks for working on this.

I wonder if it's maybe too clever? Comparing to 0 is only one of the possible fix, I usually try to make sure my types are consistent instead - which is not something a fixit could do.

The more annoying thing is that this does not interact well with `-Wold-style-cast` and most C++ guidelines. In C++ we would want to use a `static_cast` instead.

Either way, the diagnostic changes are a nice improvement


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


More information about the cfe-commits mailing list