emmtrix
C++ to C Compiler
(eCPP2C)
Translate C++ into Analyzable C Code
emmtrix C++ to C Compiler (eCPP2C) automatically translates your C++ source code into analyzable C code.
The design goal was to keep the binary compilation of the original C++ code and the binary compilation of the translated C code mostly identical. This guarantees the functional correctness of the generated C code.
eCPP2C utilizes the LLVM/Clang compiler technology to enable support of the latest features of the fast evolving C++ standard. In combination with emmtrix Parallel Studio, eCPP2C enables software parallelization of C++ applications.
Key Features
- C++ to C11 Translation: Translation of C++ to C11 (ISO/IEC 9899:2011) source code.
- LLVM/Clang Technology: Utilizes the latest LLVM/Clang compiler technology.
- Verification: Guarantees functional correctness of generated C code through a verification tool.
- Parallel Studio Integration: Integrated into the emmtrix Parallel Studio GUI to enable C++ code parallelization.
Qualification Support
An eCPP2C Qualification Kit (ISO 26262, DO-178C/330 or any comparable standard) can be provided on request.
Key Benefits
C Toolchain Compatibility
Can be used in combination with certified C compilers and C analysis tools.
Code Transparency
Demystifies how your C++ code is compiled to assembly.
Reuse Existing C++ Code
Make existing C++ applications available to C-based analysis and optimization workflows.
Supported C++ Language Features
The following list displays some of the C++ language features supported by the C++ to C Compiler:
Classes and Memory
- Classes
- Multiple inheritance
- new and delete
- Friends
- References and rvalue references
- Move semantics
- Copy elision
The emmtrix C++ to C Compiler is under active development and it aims to support the full feature set of the C++17 (ISO/IEC 14882:2017) standard as well as common GCC / Clang language extensions.
Interested in support for C++ exceptions? Although C has no direct equivalent, we can provide a solution on request. Contact us to discuss your requirements.
emmtrix C++ to C Compiler Online
Try out eCPP2C directly in your browser with Compiler Explorer.
Convert C++ code to C and compare intermediate representations (IR) using Clang and GCC — all in real time.
Discover how minimal the differences between C++ and translated C are, and explore how settings affect performance and structure.
Technical Resources
Release Notes
Explore the features, improvements and bug fixes documented in the release notes.
eCPP2C Technical Wiki
Read more about the tool, supported language features and translation workflow.
Verification Strategy
Learn how LLVM IR is used to compare original C++ and generated C code and verify translation correctness.
Frequently Asked Questions
What does eCPP2C take as input and generate as output?
eCPP2C automatically translates C++ source code into analyzable C11 source code for further compilation, analysis and optimization.
Which C++ language features are supported?
Supported features include classes, inheritance, templates, lambda expressions, references and STL containers. Full C++17 support is a development goal. Solutions for C++ exceptions can be provided on request.
How is translation correctness verified?
A verification tool compares the original C++ code and the generated C code using LLVM intermediate representation (IR) to check that the translation preserves program behavior.
Can eCPP2C be combined with emmtrix Parallel Studio?
Yes. eCPP2C is integrated into the emmtrix Parallel Studio GUI, enabling C++ applications to enter the C-based parallelization workflow.
Can I use the generated code with existing C tools?
Yes. The generated C code can be used in combination with C compilers, including certified compilers, and C code analysis tools.
Is a qualification kit available?
An eCPP2C Qualification Kit for ISO 26262, DO-178C/330 or comparable standards can be provided on request. Contact emmtrix to discuss your requirements.
Let’s Get in Touch
Would you like to translate C++ code into C or use your existing C tools with C++ applications? Contact us to discuss your code, toolchain and requirements, or request a demo.

