avr-gcc-list
[Top][All Lists]
Advanced

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

AW: [avr-gcc-list] avr-g++ (4.2.2) and exceptions


From: Haase Bjoern (PT/EMM1)
Subject: AW: [avr-gcc-list] avr-g++ (4.2.2) and exceptions
Date: Fri, 12 Oct 2007 18:45:25 +0200

IIUC, you would need run-time code for stack unwinding for exceptions and if I 
have strong doubts that these are available. Also you probably will need the 
exception tables to be placed into your RAM and I suppose that your AVR will 
not have enough of it in order to get a working system.

My suggestion is to avoid exceptions.

Yours,

Bjoern.  

-----Ursprüngliche Nachricht-----
Von: address@hidden [mailto:address@hidden Im Auftrag von David Brown
Gesendet: Freitag, 12. Oktober 2007 14:18
An: address@hidden
Betreff: Re: [avr-gcc-list] avr-g++ (4.2.2) and exceptions

Kövesdi György wrote:
> Hi,
> 
> I use C++ for my AVR projects, and everything works well. Sometimes I would 
> need to throw an exception, but it seems not ready yet. The compiler creates 
> the necessary tables (with the option -fexceptions), but the linker script 
> puts the section .gcc_except_table to wrong place, and I could not find the 
> library libsupc++, which seems necessary for exceptions.
> Does anybody know more information about it (or help me to build that missing 
> library)?
> 
> Thanks in advance
> K. Gy.
> 

As far as I understand it, there is no exceptions support in avrgcc at 
the moment.  None of the maintainers use C++ or are particularly 
knowledgeable about it, and there is relatively little interest from 
users at the moment (people mostly see C++ as a language for "big" 
processors).  Thus there is no port of the C++ libraries.  However, the 
compiler has inherited the C++ language almost automatically since it is 
standard for gcc.

So parts of C++ that need library support, such as exceptions, will not 
work.  new and delete are not (AFAIK) implemented, but it's easy enough 
to write your own versions if you want them (but static or stack 
allocation is almost always preferred in small embedded systems anyway). 
  Language features, such as classes, overloaded functions, templates, 
etc., should all work fine.  Support for global constructors (and 
destructors, if your program is supposed to stop) is in place.  I 
believe all the C library headers have the appropriate extern "C" wrappers.

If you do get anywhere with getting exceptions to work, remember that 
avr-gcc is in need of a C++ maintainer.  Failing that, if you collect 
useful information about porting the C++ libraries, then I'm sure there 
will be people interested in hearing about it.

mvh.,

David



_______________________________________________
AVR-GCC-list mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list




reply via email to

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