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

fix: Fix warnings in nanopb encoding code #2643

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

joelspadin
Copy link
Collaborator

The arg field on nanopb structs is a void* because it is shared between the encode and decode callbacks, even though the encode callback probably should not modify the data. We are passing const data using this non-const pointer, which causes warnings about discarding const. This commit explicitly casts to void* to suppress these warnings.

The "arg" field on nanopb structs is a void* because it is shared
between the encode and decode callbacks, even though the encode
callback probably should not modify the data. We are passing const data
using this non-const pointer, which causes warnings about discarding
const. This commit explicitly casts to void* to suppress these warnings.
@joelspadin joelspadin requested a review from a team as a code owner November 14, 2024 01:03
@joelspadin joelspadin added core Core functionality/behavior of ZMK studio ZMK Studio (runtime keymaps) labels Nov 14, 2024
Copy link
Contributor

@petejohanson petejohanson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@petejohanson petejohanson merged commit 7013158 into zmkfirmware:main Dec 11, 2024
47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core functionality/behavior of ZMK studio ZMK Studio (runtime keymaps)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants