Skip to content
| Marketplace
Sign in
Visual Studio Code>Linters>Cppcheck MISRANew to Visual Studio Code? Get it now.
Cppcheck MISRA

Cppcheck MISRA

daibun

| (0) | Free
Run cppcheck MISRA C 2012 on C/C++ files when saving
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

cppcheck-misra Extension

A VS Code extension that runs cppcheck with MISRA C 2012 compliance checking on C/C++ files. Automatically checks code for MISRA violations when saving files and provides visual feedback in the editor.

Features

  • Automatic checking: Runs cppcheck MISRA analysis automatically when saving C/C++ files
  • Visual diagnostics: Displays MISRA violations as errors, warnings, or informational messages based on MISRA compliance levels
  • Manual execution: Can be triggered manually via command palette
  • Configurable: Customize cppcheck path and enable/disable auto-checking
  • Performance optimized: Parallel processing for faster analysis
  • Reduced noise: Automatic suppression of common false positives

Supported MISRA Compliance Levels

  • Mandatory violations → Error (red underline)
  • Required violations → Warning (yellow underline)
  • Advisory violations → Information (blue/gray underline)

Requirements

  • cppcheck must be installed and available in your system PATH
  • Alternatively, you can specify the full path to cppcheck in the extension settings

To install cppcheck:

  • Windows: Download from cppcheck website or use package managers like chocolatey
  • macOS: brew install cppcheck
  • Linux: sudo apt-get install cppcheck (Ubuntu/Debian) or use your distribution's package manager

Extension Settings

This extension contributes the following settings:

  • cppcheck-misra.cppcheckPath: Path to cppcheck executable (default: "cppcheck")
  • cppcheck-misra.enableOnSave: Enable/disable automatic checking on file save (default: true)
  • cppcheck-misra.std: C language standard passed to cppcheck (options: c89, c99, c11, default: "c99")
  • cppcheck-misra.severityMapping.mandatory: Diagnostic severity for MISRA Mandatory violations (options: error, warning, information, hint, default: "error")
  • cppcheck-misra.severityMapping.required: Diagnostic severity for MISRA Required violations (options: error, warning, information, hint, default: "warning")
  • cppcheck-misra.severityMapping.advisory: Diagnostic severity for MISRA Advisory violations (options: error, warning, information, hint, default: "information")

Usage

Automatic Checking

  1. Open a C or C++ file
  2. Save the file (Ctrl+S / Cmd+S)
  3. The extension will automatically run cppcheck MISRA analysis
  4. Violations will be displayed as editor diagnostics with appropriate severity levels

Manual Execution

  1. Open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
  2. Type "Cppcheck MISRA: Run on current file"
  3. Select the command to run cppcheck on the current file

Known Issues

  • The extension requires cppcheck to be installed separately
  • File must be saved to disk before checking (unsaved changes are not analyzed)
  • Currently only supports single file analysis

Release Notes

0.0.1

Initial release of cppcheck-misra extension:

  • Automatic MISRA C 2012 checking on file save
  • Manual execution via command palette
  • Configurable cppcheck path and auto-check behavior
  • Visual diagnostics with MISRA compliance level-based severity

Enjoy using cppcheck-misra!

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft