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

Zephyr C++ support documentation conflicts to the code #32885

Closed
evgeniy-paltsev opened this issue Mar 4, 2021 · 10 comments · Fixed by #46077
Closed

Zephyr C++ support documentation conflicts to the code #32885

evgeniy-paltsev opened this issue Mar 4, 2021 · 10 comments · Fixed by #46077
Assignees
Labels
area: C++ area: Documentation bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug
Milestone

Comments

@evgeniy-paltsev
Copy link
Collaborator

Latest Zephyr documentation related to C++ support (doc/reference/kernel/other/cxx_support.rst) explicitly mentions that following features are not supported:

  • Dynamic object management with the new and delete operators
  • RTTI (runtime type information)
  • Exceptions

However the commit 26e0f9a says that it

  • Add support of C++ exceptions
  • Add support of C++ RTTI
  • Implements new and delete using k_malloc and k_free

which is conflicting to the documentation statements.

Hence the question to C++ experts:
Do we still have some significant flaws in these features implementation so we consider them as not supported or we just have outdated documentation?

@evgeniy-paltsev
Copy link
Collaborator Author

@nashif, @Benichou34 could you please take a look at this?
Thanks!

@nashif
Copy link
Member

nashif commented Mar 4, 2021

@evgeniy-paltsev yes, docs might be outdated, here is a list of what works and what does not: #31281

@github-actions
Copy link

github-actions bot commented May 4, 2021

This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.

@github-actions
Copy link

github-actions bot commented Jul 5, 2021

This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.

@github-actions
Copy link

github-actions bot commented Sep 4, 2021

This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.

@github-actions
Copy link

github-actions bot commented Nov 4, 2021

This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.

@andygikling
Copy link

andygikling commented Mar 26, 2022

Bump, I think the very brief description of C++ support found in cxx_support.rst is misleading people (me).

First and foremost, there is evidence in other Github Issues that "new" does work. I've tried to compile a simple application to construct a new object from a main.cpp. Main.cpp compiles with g++ but then arm-zephyr-eabi/bin/ld.bfd tells me I have an undefined reference to "new" and the linking fails. Thoughts?

@andygikling
Copy link

andygikling commented Mar 26, 2022

Never mind I can confirm new is working. For people who end up looking here, you need to change a few things in your menuconfig:

CONFIG_CPLUSPLUS=y
# Enable 17
CONFIG_STD_CPP17=y
# Newlib 
CONFIG_NEWLIB_LIBC=y
# Standar c++ libraries
CONFIG_LIB_CPLUSPLUS=y
# Support runtime type system
CONFIG_RTTI=y

@stephanosio stephanosio removed the Stale label Mar 27, 2022
@stephanosio stephanosio self-assigned this Mar 27, 2022
@stephanosio
Copy link
Member

not stale

@stephanosio stephanosio reopened this Mar 27, 2022
@carlescufi carlescufi added bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug labels Mar 29, 2022
@stephanosio stephanosio added this to the v3.1.0 milestone Mar 29, 2022
@stephanosio
Copy link
Member

Related to #43636

@stephanosio stephanosio changed the title Zephyr C++ support documentation [probably] conflicts to the code Zephyr C++ support documentation conflicts to the code May 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: C++ area: Documentation bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants