[PATCH] D142826: [Clang] Add -Wtype-limits to -Wextra for GCC compatibility

Mitch Phillips via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 1 16:19:10 PST 2023


hctim added a comment.

Hey, looks like this broke the x86_64-linux sanitizer buildbot: https://lab.llvm.org/buildbot/#/builders/37/builds/19910

You can reproduce the bot using the instructions at https://github.com/google/sanitizers/wiki/SanitizerBotReproduceBuild (substitute `buildbot_fast.sh` for `buildbot_cmake.sh` to get the right one, but I don't think using the official buildscript is necessary. This looks like a 2-stage compile is not currently `-Wextra -Werror` clean:

  /b/sanitizer-x86_64-linux/build/llvm-project/llvm/lib/ProfileData/InstrProfReader.cpp:177:41: error: result of comparison 'uint64_t' (aka 'unsigned long') > 18446744073709551615 is always false [-Werror,-Wtautological-type-limit-compare]
    if (uint64_t(Buffer->getBufferSize()) > std::numeric_limits<uint64_t>::max())
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /b/sanitizer-x86_64-linux/build/llvm-project/llvm/lib/ProfileData/InstrProfReader.cpp:227:41: error: result of comparison 'uint64_t' (aka 'unsigned long') > 18446744073709551615 is always false [-Werror,-Wtautological-type-limit-compare]
    if (uint64_t(Buffer->getBufferSize()) > std::numeric_limits<uint64_t>::max())
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I tried to whack-a-mole those two bugs (see my two commits on https://lab.llvm.org/buildbot/#/builders/37/builds/19926), but there's more latent bugs hanging around.

Probably worth reverting this and the warnings need to be fixed inside clang/llvm first, then we can make it the default.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142826/new/

https://reviews.llvm.org/D142826



More information about the cfe-commits mailing list