Re: C++ in embedded systems

From: Martin Vuille (
Date: 08/19/03

Date: 19 Aug 2003 09:07:56 -0400 (Dingo) wrote in

> (Mad@Spammers) wrote in message
> news:<>...
>> I have followed some discussions about C++ deployment in embedded
>> systems and I learned there are several criticism on C++ itself and
>> its deployment in such systems.
>> <SNIP>
>> I would appreciate if you could comment on this and give hints on
>> what to avoid when programming for embedded systems in C++.
>> Suggestions of books and links will be very much appreciated as well.
> You should check out the Rationale for Embedded C++. It gives a good
> overview of which standard C++ features were left out and why.
> I think they drew a pretty good line about which features are and
> aren't useful for embedded systems. Although I don't understand why
> they felt it was necessary to eliminate wchar_t.

Personally, I subscribe to the view that EC++ was concocted by
compiler vendors in order to create a market for their non-Standard-
compliant C++ compilers.

I find many aspects of the rationale downright insulting, making
direct or indirect references to embedded system developers' supposed
limited ability to comprehend C++.

The removal of templates, exceptions, and RTTI is arguably justified
on the grounds of efficiency although, as has been pointed-out elsewhere
in this thread, any half-decent C++ compiler will allow the user to
disable those anyway.

On the other hand, perhaps someone can explain why "mutable", namespaces,
and the C++-style casts were removed, if not to make the compiler-
writers' lives easier.


Do not send e-mail to the above address. I do not read e-mail sent there.

Relevant Pages

  • Re: Optimization questions
    ... If hand-coded assembly language is too ... maybe you should re-think upgrading to a faster processor. ... code for embedded systems will be as tight as hand coded assembly. ... realized by a compiler pays back over the whole product. ...
  • Hint instructions
    ... oftentimes the compiler wishes to know something that the programmer might already know. ... create a canonical list of operations for which hints have been proposed. ... takes bits away from instruction encodings that are already tight. ...
  • Re: embedded dataflow tracking code?
    ... some breakpoint, instead of numerical values in the CPU registers, ... compiler backend could embed some dataflow tracking code ... development environment in our source level debugging files. ... For embedded systems it is important to ship the code that ...
  • Re: zero-overhead branching
    ... Tim Wescott ... "Applied Control Theory for Embedded Systems" gives you just what it says. ... So I think C compiler from TI outperforms C compiler ...
  • Re: Which C tool?
    ... options to work in C++ but as I am dealing with embedded systems and ... has their own C compiler for their PIC line, ... you may be able to use Visual Studio - ... The notion of the incredible resource hogging, bloated POS WinCE ...