[PATCH] D39149: [libc++] Prevent tautological comparisons

Shoaib Meenai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 30 11:29:10 PDT 2017


smeenai added a comment.

I'm thinking you could account for all possible type sizes in the existing (enabled by default) warning, and have a different warning for possibly tautological comparisons. E.g. if a `long` is being compared against `INT_MAX`, you know that's only tautological on some platforms, so it should go under `-Wpossible-tautological-constant-compare` (which would only be enabled by `-Weverything` and not `-Wall` or `-Wextra`); `-Wtautological-constant-compare` should be reserved for definitely tautological cases.


https://reviews.llvm.org/D39149





More information about the cfe-commits mailing list