[PATCH] D41368: [libc++] Ignore bogus tautologic comparison warnings

Brian Cain via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 19 08:56:51 PST 2017


bcain added a comment.

In https://reviews.llvm.org/D41368#959579, @smeenai wrote:

> @mclow.lists are you okay with this approach? I'm also fine using a cast to silence the warning, as @zturner suggested, but we should suppress the warning in some way, otherwise libc++ 6 is gonna have compile warnings with clang 6 out of the box, which isn't great.
>
> A third alternative, which is the least invasive, though not complete in some sense: we just add `-Wno-tautological-constant-compare` to the compile flags for libc++ (in CMake), to suppress the warning during libc++'s compilation. There's still an instance of the warning in a header, but all other clients of the header should treat it as a system header (in which case warnings will be suppressed anyway). It's not targeted at all and could suppress legitimate instances of the warning though.


I agree, if we're willing to disable the warning in libc++ builds we should be willing to disable it via pragma.


Repository:
  rCXX libc++

https://reviews.llvm.org/D41368





More information about the cfe-commits mailing list