Embedded C++
Embedded C++ (EC++) 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 (CPU) manufacturers, including NEC, Hitachi, Fujitsu, and Toshiba, to address the shortcomings of C++ for embedded applications. The goal of the effort[1] 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".[2]
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 (typeid )
|
||
Style casts ( static_cast , dynamic_cast , reinterpret_cast , and const_cast )
|
||
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++".[3]
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[4]
- Freescale Semiconductor, (spin-off from Motorola in 2004 who had acquired Metrowerks in 1999)
- Tasking Software,[5] part of Altium Limited
- Green Hills Software[6]
Criticism
This article's Criticism or Controversy section may compromise the article's neutral point of view of the subject. (May 2018) |
The language has had a poor reception with many expert C++ programmers. In particular, Bjarne Stroustrup says, "To the best of my knowledge EC++ is dead (2004), and if it isn't it ought to be."[7] In fact, the official English EC++ website has not been updated since 2002. Nevertheless, a restricted subset of C++ (based on Embedded C++) has been adopted by Apple Inc. as the exclusive programming language to create all I/O Kit device drivers for Apple's macOS, iPadOS and iOS operating systems of the popular Macintosh, iPhone, and iPad products.[8] Apple engineers felt the exceptions, multiple inheritance, templates, and runtime type information features of standard C++ were either insufficient or not efficient enough for use in a high-performance, multithreaded kernel.[9]
References
- ↑ "EC++ Rationale". http://www.caravan.net/ec2plus/rationale.html.
- ↑ EC++ Questions and Answers
- ↑ "Embedded and Extended Embedded C++". http://www.testech-elect.com/iar/extended_embedded_c++.htm.
- ↑ "IAR Systems - Compilers and debuggers". IAR Systems website. http://www.iar.com/ew.
- ↑ "Embedded C++ compiler technology". Tasking website. http://www.tasking.com/resources/technologies/compilers/ecpp.
- ↑ "Green Hills Optimizing C/C++/EC++ Compilers". Green Hills Software website. http://www.ghs.com/products/optimizingC++EC++Compilers.html.
- ↑ "What do you think of EC++?". Bjarne Stroustrup's FAQ. http://www.stroustrup.com/bs_faq.html#EC++.
- ↑ "What is Mac OS X?". Amit Singh. http://osxbook.com/book/bonus/ancient/whatismacosx/arch_xnu.html.
- ↑ "The libkern C++ Runtime". IOKit Device Driver Design Guidelines. https://developer.apple.com/library/mac/documentation/DeviceDrivers/Conceptual/WritingDeviceDriver/CPluPlusRuntime/CPlusPlusRuntime.html#//apple_ref/doc/uid/TP30000695-BAJIBFDE.
External links
- Background and Objectives of the Embedded C++ Specification Development
- Embedded C++ Yields Faster Smaller Code, John Carbone (Embedded.com), June 19, 1998
- Building Bare-Metal ARM Systems with GNU: Part 1 - Getting Started, Miro Samek, Quantum Leaps, June 26, 2007
- Technical Report on C++ Performance, by WG 21 of ISO Subcommittee SC 22
Original source: https://en.wikipedia.org/wiki/Embedded C++.
Read more |