PiotrZSL added a comment. I'm not sure if this is right fix, example:
const std::size_t k1Tb = 1024 * 1024 * 1024 * 1024; This is detected by -Winteger-overflow, but this: const std::size_t k1Pb = 1024U * 1024U * 1024U * 1024U * 1024U; is not detect by anything except this check, even that it overflow to 0. Funny thing that if we change those unsigned to signed, then its detected by -Winteger-overflow For me we shoudn't silent those issues, if someone want they they can always put nolint or explicit cast, we could consider adding some basic calculations just to verify if there will be no overflow, but still proper way would be to provide warning that would say, hey, write this as: "1024LU * 1024LU" Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158338/new/ https://reviews.llvm.org/D158338 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits