[ECOS] eCos and C++

Paul D. DeRocco pderocco@ix.netcom.com
Thu Apr 2 08:02:00 GMT 2009

> From: graham labdon
> Hello everyone
> Can anyone please tell me if eCos supports C++ STL

The problem with the C++ library (not just containers, but C++ strings too)
is that it relies on exceptions to report out-of-memory, and off-the-shelf
eCos doesn't properly support C++ exception handling. (At least 2.x
doesn't--I don't think 3.0 does either.)

But if you have so much RAM that you know you'll never run out, then you may
be able to fudge it. I would assume you'd have to change the compiler flags
manually, and I can't promise that the compiler won't generate code that
breaks something even when exceptions aren't actually thrown. I'd write some
test code that contains automatic objects with destructors, and maybe a
try/catch block, and read the assembler output to make sure it doesn't refer
to some data structure that eCos doesn't initialize. And of course, this
hackery might work on some CPUs but not others.

The right way to do this is to buy the eCosCentric version of eCos, which
has a modified kernel that properly supports C++ exceptions in a thread-safe
manner. Don't know if the 3.0 version is ready yet.


Ciao,               Paul D. DeRocco
Paul                mailto:pderocco@ix.netcom.com

Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

More information about the Ecos-discuss mailing list