[llvm] [NFC] Suppress cppcheck false-positives in llvm/include/llvm/Support/MathExtras.h (PR #175417)

Oliver Stöneberg via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 12 02:42:19 PST 2026


firewave wrote:

> Alternatively to fixing cppcheck we actually CAN suppress errors with inline comments in the source code (OpenScanHub turns out has [`--inline-suppr`](https://github.com/csutils/cscppc/blob/f4f58d209a518ebbf26bd22c30e0a11d9340ee1b/src/cscppc.c#L60) set This is the most non-invasive yet beneficial change I can think of and I'm going to change this PR to do that. I know that the error `legacyUninitvar` is a legacy check but it does exists and may actually catch something so I think it is not going to go away soon.

It is up to the LLVM devs to decide if such annotations are desired in the code. The problem is that these annotations will rot if do not generate `unmatchedSuppression` messages which tells you that you have to remove them. That requires `--enable=information` to be set but that causes more noise than wanted right now but could be adjusted (see https://github.com/danmar/cppcheck/pull/7173).

Maybe these should to be carried by OpenScanHub via a suppression file instead. Not sure if that would be possible.

On a side note - at some point it looked like the CI is also running Cppcheck but nobody seemed to really look into the findings.

https://github.com/llvm/llvm-project/pull/175417


More information about the llvm-commits mailing list