Re: which object orient language is most suitable for embedded programming?




"Vladimir Vassilevsky" <antispam_bogus@xxxxxxxxxxx> wrote in message
news:dtI9h.9554$6t.5435@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx


Peter Dickerson wrote:

based on the C startup because I needed
to init hardware in C earlier than zeroing BSS. The additional code
needed to support C++ was a scan of a table of static constructors before
main and destructors after.

Besides that, the C++ startup has a lot of extra functionality that can be
used on the special occasions. Such as: If (OS == blabla), if (library ==
foobar), if (CPU_version == 12345) and so on, so forth.
Of course, you can eliminate most of that. How much time it will take? Are
you sure there will not be a problem in the future because you removed
something essential?

In general there is nothing extra needed in C++ startup apart from
the static constructors Peter mentioned. If you don't use statically
constructed objects, the code required to do so should not be linked
in. In a compiler I worked on, the startup code for C and C++ was
identical - calls to initialization routines for features that aren't
used are automatically removed. That is how things should be.

Wilco


.