-
Notifications
You must be signed in to change notification settings - Fork 0
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
C++ 11 Support #2428
Comments
by Andy Ross: RTTI and exceptions would be possible with (mostly) just a few compiler flags. Note that both have siginificant code size implications which make them sorta poor choices for an RTOS environment. And like all mixed C/C++ environments, exceptions will be tricky to use in Zephyr: you have to throw them and catch them from within "pure" C++ code. If there is a C function on the stack between your throw and catch (e.g. a driver or network stack callback, etc...) it won't work. I'd expect new/delete to work normally right now, as-is, as long as you are linking against newlib which includes a (mostly) working malloc. We could wire up k_malloc() for that purpose too, though again most of our targets have a very constrained heap. It hasn't been a priority, but I don't think much would be required to validate this usage. Not sure what you want a static destructor for. You want to hook the destructors to run at a "system shutdown" moment? We don't have that, though I guess we could add it. |
by Soheil Qanbari: Thank you, Andy Ross , really. Your reply means a lot to us. :) We have a little engine and would love to build it for ZEP, as we believe it is the future generation of RTOSs. I will come back to you shortly with the short list of libraries that we need and would be very thankful for your comment on them. My sincere thanks again. |
by Soheil Qanbari: Hi Andy Ross , I hope you are doing well. We need the libs for threads, iostream, vector, map, set,... Here are the includes we need to build our engine on the Microcontroller using ZEP. #include Is there any wiki, list, or documentation on the detail c++ support? I appreciate your input really and thank you in advance... |
by Andy Ross: There's absolutely no way that all of that is going to be supported. In particular the POSIX-based filesystem stuff doesn't exist in Zephyr. We aren't a unix. Things that work directly on memory and are header-only libraries (e.g. STL & the rest of the containers and algorithms stuff) should be OK when linked with newlib (which provides the heap). Things that work with the underlying OS are going to need significant porting to work with Zephyr. |
Reported by Soheil Qanbari:
Hi,
Based on the C++ Support for Applications page:
http://zephyr-docs.s3-website-us-east-1.amazonaws.com/online/dev/kernel/other/cxx_support.html
Is there any plan on when to support the following c++ functionalities?
This will open a great space to deploy c++ applications on Zephyr too. I appreciate any input.
Thank you.
(Imported from Jira ZEP-2599)
The text was updated successfully, but these errors were encountered: