Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-12206

Add diagnostic output to the Clang analyser task

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • WT11.3.0, 8.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Storage Engines
    • 1
    • 2024-02-06 tapioooooooooooooca

      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.

            Assignee:
            andrew.morton@mongodb.com Andrew Morton
            Reporter:
            jeremy.thorp@mongodb.com Jeremy Thorp
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: