[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [OT] [avr-gcc-list] c++ problems

From: Branislav Katreniak
Subject: Re: [OT] [avr-gcc-list] c++ problems
Date: Fri, 22 Jul 2005 10:20:08 +0200
User-agent: Mutt/1.5.9i

> I read your posting in the avr-gcc mailing list. I am very interested in 
> using C++ on microcontrollers, but I didn't found much information about 
> this topic in the internet. I think that the templating system of C++ 
> would be a great benefit for microcontrollers. But also virtual 
> functions could help in several situations.
> Do you know, where I can get some detailed information about the topic?

You are right, not much information about this topic available. Good
points are in in avr-libc FAQ. I just tried it and found out that it

C++ on avr is very good for encapsulating data and objects without any
important code/ram penalty. But you shouldn't create deep class
hierarchy and shouldn't use too much virtual functions.

My observations:

Working things:
- C++ language is correctly parsed (full g++ as on other plaforms).
- Constructors, destructors, virtual functions, inline functions work.
- Constructors for statically created objects are correctly called.

- You must provide operators "new" and "delete". (No big problem. You
  just define them.)
- Pure functions do not work. (Some unresolved symbols.)
- Constructors and destructors are twice in the flash.
- Virtual tables are stored in RAM memory. (Maybe the same problem as
  was with jump tables in the early gcc 4.0)
- Templates don't work. (Maybe some magic switch to the compiler could
- Runtime type detection and exception do not work. (This is mentioned
  in FAQ.)

Most of the not working things are tied to the gcc and only few people
is hacking it (not me).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]