[PATCH] D158338: [clang-tidy] [bugprone-implicit-widening-of-multiplication-result] Improved check to ignore false positives with integer literals.

2023-08-19 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added a comment. Yes doing some basic calculations would be probably the best, but for that we would need to implement some "calculator" or find some exist implementation some're in clang. Even if it would support only basic operations like * Repository: rG LLVM Github Monorepo

[PATCH] D158338: [clang-tidy] [bugprone-implicit-widening-of-multiplication-result] Improved check to ignore false positives with integer literals.

2023-08-19 Thread Félix-Antoine Constantin via Phabricator via cfe-commits
felix642 added a comment. Hi @PiotrZSL thank you for taking the time to look at this revision. I agree with you we should not silence a warning if no other tool can diagnose the issue. I'm guessing that -Winteger-overflow does no trigger any warning on unsigned "overflow" since behavior is

[PATCH] D158338: [clang-tidy] [bugprone-implicit-widening-of-multiplication-result] Improved check to ignore false positives with integer literals.

2023-08-19 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added a comment. In short I'm against simply ignoring literal calculations because this check is only thing that currently detect this issue: https://github.com/llvm/llvm-project/issues/64828 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D158338: [clang-tidy] [bugprone-implicit-widening-of-multiplication-result] Improved check to ignore false positives with integer literals.

2023-08-19 Thread Piotr Zegar via Phabricator via cfe-commits
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

[PATCH] D158338: [clang-tidy] [bugprone-implicit-widening-of-multiplication-result] Improved check to ignore false positives with integer literals.

2023-08-19 Thread Félix-Antoine Constantin via Phabricator via cfe-commits
felix642 updated this revision to Diff 551771. felix642 added a comment. Fixed format Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158338/new/ https://reviews.llvm.org/D158338 Files:

[PATCH] D158338: [clang-tidy] [bugprone-implicit-widening-of-multiplication-result] Improved check to ignore false positives with integer literals.

2023-08-19 Thread Félix-Antoine Constantin via Phabricator via cfe-commits
felix642 created this revision. Herald added subscribers: PiotrZSL, carlosgalvezp, xazax.hun. Herald added a reviewer: njames93. Herald added a project: All. felix642 requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. The