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

Example Planner does not compile #166

Closed
CameronLovesCoffee opened this issue Sep 17, 2021 · 2 comments · Fixed by #167
Closed

Example Planner does not compile #166

CameronLovesCoffee opened this issue Sep 17, 2021 · 2 comments · Fixed by #167

Comments

@CameronLovesCoffee
Copy link

CameronLovesCoffee commented Sep 17, 2021

Ubuntu 18.04

C++ 17 - set(CMAKE_CXX_STANDARD 17)

line 264:
CYAML_FIELD_SEQUENCE(
"depends", CYAML_FLAG_POINTER | CYAML_FLAG_OPTIONAL,
struct task, depends,
&string_ptr_schema, 0, CYAML_UNLIMITED),

error message:
error: designator order for field ‘cyaml_schema_field::data_offset’ does not match declaration order in ‘const cyaml_schema_field_t’ {aka ‘const cyaml_schema_field’}

cause:
the CYAML_FIELD_SEQUENCE declares the struct in the wrong order

fix:
edit the CYAML_FIELD_SEQUENCE (and other macros) to declare the struct members in the right order

@CameronLovesCoffee
Copy link
Author

After reading about designated initialisers, I see that this is a C vs C++ issue
Can you make the change so that it compiles in C++ as well as C?

@tlsa
Copy link
Owner

tlsa commented Sep 17, 2021

Should be fine on main now. Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants