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

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

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


From: David Brown
Subject: Re: [avr-gcc-list] avr-g++ (4.2.2) and exceptions
Date: Fri, 12 Oct 2007 14:18:09 +0200
User-agent: Thunderbird 2.0.0.6 (Windows/20070728)

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





reply via email to

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