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

Build warnings -- [-Wunused-but-set-variable] #249

Open
henrygab opened this issue Aug 14, 2020 · 0 comments
Open

Build warnings -- [-Wunused-but-set-variable] #249

henrygab opened this issue Aug 14, 2020 · 0 comments

Comments

@henrygab
Copy link

henrygab commented Aug 14, 2020

See example logs at https://github.com/adafruit/ArduinoCore-samd/runs/965558867

Simplified log

$.../USBHost/examples/USB_desc/USB_desc.ino:
    In function 'byte getconfdescr(byte, byte)':

$.../USBHost/examples/USB_desc/USB_desc.ino:213:8:
    warning: variable 'rcode' set but not used [-Wunused-but-set-variable]
  213 |   byte rcode; // FIXME -- code does not actually check return code (no error handling!)
      |        ^~~~~

-Wunused-but-set-variable information

A variable is written to, but never read from.

Interpretation

The code gets a return value from a function that could fail.
However, it never checks that return value, and thus lacks any error handling.

Recommendation

tbd

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

1 participant