Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[patch #7467] Add support for c++ new and delete operators #784

Open
avrs-admin opened this issue Jan 31, 2022 · 2 comments
Open

[patch #7467] Add support for c++ new and delete operators #784

avrs-admin opened this issue Jan 31, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@avrs-admin
Copy link

Thu 17 Feb 2011 05:06:48 AM CET

Patch adds support to avr-libc for the c++ operators new and delete.

This patch wraps the malloc and free c functions in the new and delete operators, and as such does not support exceptions as the standard c++ new and delete do.

The patch adds c++ compilation support to configure.ac so that the file new.cc is compiled into the library. new.cc is added to stdlib. devtools files Device.am and Architecture.am are updated to fix AM_CXXFLAGS to include -mmcu and other AVR specific compile options.

This patch includes updating the faq documentation c++ support section to update the information about new and delete.

Tested on avr-libc from svn 2217 on system with avr c++ support

Todo: test compiling avr-libc on system without avr c++ support. It should simply not compile and add new.cc to libc

file #22707: stdlib_new_delete.patch

This issue was migrated from https://savannah.nongnu.org/patch/?7467

@avrs-admin
Copy link
Author

Eric Weddington
Fri 13 May 2011 01:17:33 AM CEST

We need to decide if we even want C++ code in avr-libc. Though I understand the usefulness of this patch since we still don't have libstdc++ built yet.

@avrs-admin
Copy link
Author

Bradley Jarvis <bradley_jarvis>
Fri 13 May 2011 05:31:50 AM CEST

I say yes, but I am biased. It would save me having to add my patch every time I update avrlibc. And since I use gentoo it would be a bit of a pain to do this for each update (I currently compile/install avrlibc manually).

c++ support is also mentioned in the avrlibc FAQ, which technically is a gcc issue since that is where libstdc++ resides.

At the end of the day all it does is add an extra feature avr gcc support that if not wanted can be compiled out (simply compile library without c++ support).

The C++ support added to the avrlibc compilation files has been done in a standard way too (not just a hack fix) even if the patch in itself is a hack fix.

@sprintersb sprintersb added the enhancement New feature or request label Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants