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

Compiler warning with enums #65

Open
olisolec opened this issue May 3, 2023 · 0 comments
Open

Compiler warning with enums #65

olisolec opened this issue May 3, 2023 · 0 comments
Assignees

Comments

@olisolec
Copy link

olisolec commented May 3, 2023

Using enums the generator uses the following code for deserialization:

success &= ucdr_deserialize_uint32_t(reader, (uint32_t)&topic->errorId);

which will cast the pointer to the enum to an uint32_t value which does not match the definition of the function:

bool ucdr_deserialize_uint32_t(ucdrBuffer * ub, uint32_t * value);

this will generate compiler warnings like this:

warning: passing argument 2 of 'ucdr_deserialize_uint32_t' makes pointer from integer without a cast [-Wint-conversion]

BTW: The assumption that enum types will be 4 byte integer in memory makes the code implementation specific.

@Acuadros95 Acuadros95 self-assigned this May 3, 2023
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

No branches or pull requests

2 participants