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

Investigate compiler-based tools for syntax & usage checks

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Backlog
    • Component/s: None
    • Labels:
      None

      Description

      We should investigate compiler-based tools to perform the code analysis we currently do with shell scripts in dist/.  If we had more flexible tools that actually understand C, it would be easier to introduce new checks as we discover issues we want to avoid in our code.

      Our current scripts are based on clever use of grep and sed.  Some of them are made possible by the style and formatting that clang-format enforces. There are limitations to what can be detected in this way. libclang lets you build custom code analysis tools using the AST generated by the clang parser.  It has Python bindings and there is an existing ecosystem of tools built using it. coala.io, for example, lets you define rules and standards to be followed in your code (hat tip: Michael Cahill).  There are probably other options out there—both things built on clang and other non-clang tools.

        Attachments

          Activity

            People

            Assignee:
            backlog-server-storage-engines Backlog - Storage Engines Team
            Reporter:
            keith.smith Keith Smith
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: