danmar/simplecpp

C++ preprocessor

263

stars

735

commits

C

primary language

Aug 25, 2026

updated

README

Simple C/C++ preprocessor

NOTE: This repository was recently moved from https://github.com/danmar/simplecpp to https://github.com/cppcheck-opensource/simplecpp. Please make sure to update all your references to it accordingly.

This is a simple C/C++ preprocessor.

The goal is to have good conformance with the C and C++ standards and to handle nonstandard preprocessor extensions in gcc / clang / visual studio preprocessors. Most of the preprocessor testcases in gcc and clang are handled OK by simplecpp.

To see how you can use simplecpp in your project, you can look at the file main.cpp.

Simplecpp has better fidelity than normal C/C++ preprocessors.

  • Preprocessor directives are available.
  • Comments are available.
  • Tracking macro usage.

This information is normally lost during preprocessing but it can be necessary for proper static analysis.

Status

CI-windows CI Unixish

Compiling

Compiling standalone simplecpp preprocessor:

Either:

g++ -o simplecpp main.cpp simplecpp.cpp

Or:

make

Compiling and running tests (you need python to run the gcc/clang test cases)

make test

Contributors

(top 30 of 46)

danmar

392 commits

firewave

191 commits

glankk

17 commits

amai2012

15 commits

danmar/simplecpp

C++ preprocessor

263

stars

735

commits

C

primary language

Aug 25, 2026

updated

README

Simple C/C++ preprocessor

NOTE: This repository was recently moved from https://github.com/danmar/simplecpp to https://github.com/cppcheck-opensource/simplecpp. Please make sure to update all your references to it accordingly.

This is a simple C/C++ preprocessor.

The goal is to have good conformance with the C and C++ standards and to handle nonstandard preprocessor extensions in gcc / clang / visual studio preprocessors. Most of the preprocessor testcases in gcc and clang are handled OK by simplecpp.

To see how you can use simplecpp in your project, you can look at the file main.cpp.

Simplecpp has better fidelity than normal C/C++ preprocessors.

  • Preprocessor directives are available.
  • Comments are available.
  • Tracking macro usage.

This information is normally lost during preprocessing but it can be necessary for proper static analysis.

Status

CI-windows CI Unixish

Compiling

Compiling standalone simplecpp preprocessor:

Either:

g++ -o simplecpp main.cpp simplecpp.cpp

Or:

make

Compiling and running tests (you need python to run the gcc/clang test cases)

make test

Contributors

(top 30 of 46)

danmar

392 commits

firewave

191 commits

glankk

17 commits

amai2012

15 commits

Languages

C

63.7%

C++

32.4%

Python

2.0%