-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
ZCBOR code generator generates names not compatible with C++ #54092
Comments
This should really have been posted to https://github.com/NordicSemiconductor/zcbor |
Actually I can see that there are some C++ improvements commits but they are not available on the zephyrproject-rtos/zcbor forked repository. Can you bump there the newest version? |
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. |
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. |
@oyvindronningstad this has been marked as stale 3 times. Is this an issue? If it isn't can you close this? |
It is an issue. It is tracked by NordicSemiconductor/zcbor#314. |
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. |
@oyvindronningstad Any chance to upstream zcbor fix to zephyr? |
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. |
@oyvindronningstad Ping |
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. |
@oyvindronningstad If upstreaming is not possibel or planned then please close this issue. |
Describe the bug
There is a problem with compiling ZBOR code generated from .cddl files when we use it in the application written in C++.
To be precise the problem occurs if we want to generate Union type. The generated code can be compiled in C but it is not working for C++ due to generated variables names conflicts.
To Reproduce
Simple example showing the problem was created and it is available on my repository -> https://github.com/kborowski3/zcbor_union_test
This is a simple application, which just includes the generated zcbor code. ZCBOR code is generated using
zcbor_union_test.cddl
which contains a simple union definition.zcbor_union_test.cddl
file contentwhere Foo is either an int or bstr.
The code is generated using ZCBOR code generator:
The problem is in the
zcbor_union_test.h
file. The content of the file was pasted below.As you can see there is a problem with the enum's and union's fields names. Both union and enum has a member
_Foo_int
and_Foo_bstr
, which cannot be compiled in C++ code.Steps to reproduce the behavior:
Expected behavior
The application compiles successfully.
Logs and console output
Environment
The text was updated successfully, but these errors were encountered: