Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>SafeCpp — Memory Safety AnalyzerNew to Visual Studio Code? Get it now.
SafeCpp — Memory Safety Analyzer

SafeCpp — Memory Safety Analyzer

Vatsal Khosla

|
2 installs
| (0) | Free
Real-time C++ memory safety analysis: use-after-free, null dereferences, memory leaks, and cross-function UAF. Requires the safecpp binary on PATH — see https://safecpp.dev for install instructions.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

SafeCpp — VS Code Extension

Real-time C++ memory safety analysis powered by SafeCpp and Clang LibTooling.

Features

  • Squiggly underlines on use-after-free, null dereferences, memory leaks, and cross-function UAF — inline, as you save
  • Hover tooltips explaining what went wrong and how to fix it
  • Problems panel integration (Ctrl+Shift+M) showing all findings across your project
  • Status bar showing issue count — click to open the full HTML report
  • Related information links: for UAF, the error points to the use site and a related location link shows the free site
  • Dark/light theme in HTML reports

Requirements

The safecpp binary must be installed and on your PATH (or configured in settings).

Quick install:

# From source
git clone https://github.com/you/safecpp && cd safecpp && make
sudo cp safecpp /usr/local/bin/

Usage

  1. Open any .cpp or .c file
  2. Save it — analysis runs automatically
  3. See squiggly underlines for any violations
  4. Check the Problems panel (Ctrl+Shift+M) for the full list
  5. Click the SafeCpp: N issues status bar item to open the HTML report

Commands

Command Description
SafeCpp: Analyze Current File Run on the active file
SafeCpp: Analyze Workspace Run on all C/C++ files in workspace
SafeCpp: Open HTML Report Open last report in browser
SafeCpp: Clear All Diagnostics Remove squiggly lines

Settings

Setting Default Description
safecpp.binaryPath "safecpp" Path to binary
safecpp.runOnSave true Auto-analyze on save
safecpp.compileCommandsPath "" Path to compile_commands.json
safecpp.autoDetect true Auto-detect build system
safecpp.severityThreshold "warning" Minimum severity to show
safecpp.configFile "" Path to .safecpp.json

Example

void example() {
    int* ptr = new int(42);
    delete ptr;
    int val = *ptr;  // ← red squiggly: use-after-free
    //  SafeCpp: Use-after-free: 'ptr' freed at line 3, used here
}
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft