[clang-tools-extra] Add bugprone-undefined-sprintf-overlap (PR #114244)
Chris Cotter via cfe-commits
cfe-commits at lists.llvm.org
Sat Jan 4 19:00:25 PST 2025
ccotter wrote:
Thanks both @nicovank @5chmidti for the overlapping reviews. I got sidetracked, but am coming back to hopefully finish this up.
Re: supporting more use cases, I found nearly all bugs in our codebase were of the simple form `sprintf(a, "", ..., a, ...)` with a simple DeclRefExpr. None were of the form `sprintf(a[0][0], "", ..., a[0][0], ...)` (at least, none that I couple find with a more naive `grep` and visual inspection), or anything else suggested above. And, since matching on other expressions more generically like more deeply nested arrays or `(buf+10)` led to more complex matchers, I opted for the simpler cases my check can find in its current form.
Let me look at `utils::areStatementsIdentical` to see if this could help expand the forms that the tool can find.
https://github.com/llvm/llvm-project/pull/114244
More information about the cfe-commits
mailing list