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

Remove extraneous zero initializers to clean up Qurt compiler warnings #28634

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

katzfey
Copy link
Contributor

@katzfey katzfey commented Nov 15, 2024

Extraneous zero initializers for global / static variables were removed to get rid of the following Qurt compiler warnings:

../../libraries/AP_RCProtocol/spm_srxl.cpp:78:36: warning: suggest braces around initialization of subobject [-Wmissing-braces]
SrxlTelemetryData srxlTelemData = {0};
^
{}
../../libraries/AP_RCProtocol/spm_srxl.cpp:83:34: warning: suggest braces around initialization of subobject [-Wmissing-braces]
static SrxlDevice srxlThisDev = {0};
^
{}
../../libraries/AP_RCProtocol/spm_srxl.cpp:91:36: warning: suggest braces around initialization of subobject [-Wmissing-braces]
static SrxlReceiverStats srxlRx = {0};
^
{}
../../libraries/AP_RCProtocol/spm_srxl.cpp:91:36: warning: suggest braces around initialization of subobject [-Wmissing-braces]
static SrxlReceiverStats srxlRx = {0};
^
{}

Since this data will end up in .bss and be zeroed out it does not need explicit zero initializers.

@andyp1per
Copy link
Collaborator

This is an external library, modifying it makes it hard to integrate newer versions - that's why these have not been fixed previously

@katzfey
Copy link
Contributor Author

katzfey commented Nov 15, 2024

Shoot! I have 3 PR's with changes to the spm_srxl files. Unfortunately, it's a C file that was copied over and given the cpp extension. Then the C++ compiler gives warnings because it has C specific stuff in it.

@katzfey
Copy link
Contributor Author

katzfey commented Nov 15, 2024

@andyp1per Take a look at PR28643: #28643

If that is a more reasonable way to deal with these compiler warnings then I can close this PR.

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