[llvm] [NFC] Address cppcheck legacyUninitvar (PR #175417)
Konrad Kleine via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 12 00:59:55 PST 2026
kwk wrote:
> That looks like a false positive to me.
>
> IMO it should only be reported as (potentially) uninitialized when the value is actually read before anything was assigned. I filed https://trac.cppcheck.net/ticket/14381 about it.
@firewave indeed, this is a false positive and I should have updated the PR's description to explicitly say that it mitigates the report, not the cause.
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.
https://github.com/llvm/llvm-project/pull/175417
More information about the llvm-commits
mailing list