Embedded C++
Embedded C++ is a dialect of the C++ programming language for embedded systems. It was defined by an industry group led by major Japanese central processing unit manufacturers, including NEC, Hitachi, Fujitsu, and Toshiba, to address the shortcomings of C++ for embedded applications. The goal of the effort is to preserve the most useful object-oriented features of the C++ language yet minimize code size while maximizing execution efficiency and making compiler construction simpler. The official website states the goal as "to provide embedded systems programmers with a subset of C++ that is easy for the average C programmer to understand and use".
Differences from C++
Embedded C++ excludes some features of C++.Feature | ISO/ANSI C C++ | Embedded C++ |
Exception handling | ||
Multiple inheritance | ||
mutable, a storage class specifier | ||
Namespaces | ||
Templates | ||
Run-time type information | ||
Style casts | ||
Virtual base classes |
Some compilers, such as those from Green Hills and IAR Systems, allow certain features of ISO/ANSI C++ to be enabled in Embedded C++. IAR Systems calls this "Extended Embedded C++".
Compilation
An EC++ program can be compiled with any C++ compiler. But, a compiler specific to EC++ may have an easier time doing optimization.Compilers specific to EC++ are provided by companies such as:
- IAR Systems
- Freescale Semiconductor,
- Tasking Software, part of Altium Limited
- Green Hills Software
Criticism