WT-12144 updated the Clang static analyser task (thanks @Etienne for doing that!), which is great as clang-tidy and scan-build can carry out lots of useful checks on our code. For example the checks helped find these bugs: WT-12164 / WT-12169.
However, I’ve tripped over some issues after I merged develop into a couple of branches I have open (thereby applying WT-12144 to them). Specifically the clang analyser task failed because I’d some changed code in a way that changed the warnings that the analyser was generating.
The s_clang_scan script diffs the results of the analysis of your code with the ‘known’ warnings in s_clang_scan.diff, and generates an error on any difference. That difference could be because you’ve triggered another warning, or because (as in one of my branches) you’ve actually removed a warning.
If you've changed the code to remove a warning, then the solution is simple: remove the corresponding warning from the diff file.
If you've changed the code and a new warning appears, then it's currently tricky to work out the specific line of code that is generating the new warning. This ticket will add output in this scenario to aid diagnosis. A simple approach would be, on failure, to simply 'cat' the scan-build output to the logs.
- related to
-
WT-12203 Reduce/eliminate warnings from the clang static analyser
- Backlog