Show HN: C and C++ preprocessor for modern memory safety

2 weeks ago 1

A Next-Generation Memory-Safe Preprocessor for C & C++

Bringing modern memory safety and zero-configuration builds to classic C & C++.

cdefer draws inspiration from Zig & Golang, integrating their modern safety and simplicity features directly into C & C++ — while staying fully within the existing languages (no new language required).

cdefer is an open-source preprocessor and tooling layer for C & C++ with one core mission, make C & C++ memory-safe by default — without changing the language.

It enhances traditional compilation pipelines with automatic memory safety checks, build orchestration, and (soon) built-in package management. Unlike other approaches, cdefer does not require switching languages, runtimes, or toolchains.

Full Memory Safety (Implemented ✅)

  • Enforces safe memory access patterns.
  • No ghost allocation.
  • Detects common vulnerabilities:
    • Buffer overflows
    • Use-after-free
    • Double free
    • Null dereferences
  • Applies compile-time and runtime instrumentation.
  • 100% compatible with standard C & C++ compilers.

No Makefile Required (Implemented ✅)

  • Automatic build system generation
  • Detects source files intelligently.
  • Configures compiler flags and output targets.
  • Works across platforms (Linux, macOS, Windows).
  • Zero external dependencies.

Built-In Package Manager (In Progress 🚧)

  • Install libraries with a simple command.
  • Resolves dependencies automatically.
  • Versioning and reproducible builds.
  • Future support for:
    • Remote repositories
    • Private registries
    • Precompiled binary packages
Feature Status
Memory Safety Engine ✅ Complete
Build Auto-Gen ✅ Complete
CLI Tooling ✅ Basic Version
Package Manager 🚧 In Progress
Documentation 🔜 Planned
Linter 🔜 Planned
LSP for IDEs 🔜 Planned
OS Status
Linux ✅ Complete
Macos ✅ Complete
Windows 🚧 In Progress
curl -L https://raw.githubusercontent.com/krishnaTORQUE/cdefer/refs/heads/main/install.sh | sh
curl -L https://raw.githubusercontent.com/krishnaTORQUE/cdefer/refs/heads/main/uninstall.sh | sh
https://github.com/krishnaTORQUE/start
  • This project is still in Alpha.

This project is licensed under the MIT | View License

Unless you explicitly state otherwise, any contribution intentionally submitted for this project by you, shall be licensed as MIT, without any additional terms or conditions.

Read Entire Article