Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
LGTM.
clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp | ||
---|---|---|
414–415 | What would you think about a SmallVector<2> for these? It would allow you to handle them with a (short) for loop instead of separate commands. |
By the way here is a concrete example where this patch is needed to squash a false positive: https://codechecker-demo.eastus.cloudapp.azure.com/Default/report-detail?run=postgres_REL_13_0_stdclf_notetag_interesting_test_3&is-unique=on&report-hash=49939ae1896dff1ad782092b8534bd68&report-filepath=%2arelcache.c&report-id=1942889
clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp | ||
---|---|---|
414–415 | It does not look to be much better, the only place where a loop can be used is in the apply function but because optionals (that are to be checked at both values) it is not much better. And a vector could be constructed in the apply function too, but for 2 elements it is not important. |
What would you think about a SmallVector<2> for these? It would allow you to handle them with a (short) for loop instead of separate commands.