Coding Standard

Coding Standard

Coding standard: AUTOSAR C++14

MISRA

CERT Coding Standards

CWE

Static Analysis tools

Open-Source Tools with MISRA Support

Cppcheck #

Cppcheck: A popular open-source static analysis tool for C/C++ that includes an addon (a Python script) for checking a number of MISRA C:2012 rules. The script provides rule IDs for violations, although it does not contain the full MISRA rule text due to copyright restrictions (the MISRA documents are proprietary).

Clang-Tidy #

This is part of the LLVM compiler infrastructure and is extensible. There are community-driven efforts and separate repositories, such as clang-tidy-automotive, that provide checks inspired by or mapped to MISRA rules. The main LLVM project cannot accept copyrighted MISRA rule content, so community workarounds are necessary. https://github.com/PeterHallonmark/clang-tidy-automotive https://github.com/PeterHallonmark/clang-tidy-misra

GCC-based checkers: #

Researchers have developed static analysis detectors for MISRA-C’s single-translation-unit rules based on the GNU Compiler Collection (GCC). The source code is available for download on GitHub.

OpenMRC: #

An open-source MISRA-C rule checker developed as an Eclipse CDT (C/C++ Development Tooling) plugin. It builds an Abstract Syntax Tree (AST) using the Eclipse CDT parser to check for violations of MISRA-C:2004 rules.

comments powered by Disqus