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

HID: Zero-initialize pointer members #19

Closed
wants to merge 4 commits into from

Conversation

forderud
Copy link
Contributor

@forderud forderud commented Sep 9, 2024

I'm new to Arduino development, so I'm not sure if variable are zero-initialized by default. Regardless, it's often regarded good practice to explicitly zero-initialize pointers to reduce risk of treating uninitialized pointers as valid.

Combine with moving of other member initialization from constructor in cpp-file to header.

I'm new to Arduino development, so I'm not sure if variable are zero-initialized by default. Regardless, it's often regarded good practice to explicitly zero-initialize pointers to reduce risk of treating uninitialized pointers as valid.
@abratchik
Copy link
Owner

HID.h/HID.cpp is a part of Arduino Core. If you check the original you will find that it was half-cooked. They only supported USB HID reports but not the features. You may check this PR - submitted it long ago to the Arduino team but they did not merge it for some reason.

@abratchik abratchik closed this Sep 16, 2024
@forderud
Copy link
Contributor Author

I just submitted the relevant subset of this PR to ArduinoCore-avr in arduino/ArduinoCore-avr#571. Let's wait and see how it's received.

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 this pull request may close these issues.

2 participants