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.
- 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.
- Automatic build system generation
- Detects source files intelligently.
- Configures compiler flags and output targets.
- Works across platforms (Linux, macOS, Windows).
- Zero external dependencies.
- Install libraries with a simple command.
- Resolves dependencies automatically.
- Versioning and reproducible builds.
- Future support for:
- Remote repositories
- Private registries
- Precompiled binary packages
| Memory Safety Engine | ✅ Complete |
| Build Auto-Gen | ✅ Complete |
| CLI Tooling | ✅ Basic Version |
| Package Manager | 🚧 In Progress |
| Documentation | 🔜 Planned |
| Linter | 🔜 Planned |
| LSP for IDEs | 🔜 Planned |
| Linux | ✅ Complete |
| Macos | ✅ Complete |
| Windows | 🚧 In Progress |
- 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.
.png)

