Suvarna Garge (Editor)

Embedded C

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit

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 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".

Contents

Differences from C++

Embedded C++ is a proper subset of C++. The following language features have been removed:

  • Multiple inheritance
  • Virtual base classes
  • Run-time type information (typeid)
  • New style casts (static_cast, dynamic_cast, reinterpret_cast and const_cast)
  • The mutable storage class specifier
  • Namespaces
  • Exceptions
  • Templates
  • Some compilers (such as Green Hills and IAR Systems) allows specific features in the above list to be re-enabled if desired, an implementation called "extended embedded C++".

    In addition, many users of Embedded C++ avoid the Standard Template Library with its use of dynamic memory allocation.

    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, (spin-off from Motorola in 2004 who has acquired Metrowerks in 1999)
  • Tasking Software, part of Altium Limited
  • Green Hills Software
  • Criticism

    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." 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 Mac OS X and iOS operating systems of the popular MacBook, iPhone, and iPad products. 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.

    References

    Embedded C++ Wikipedia