adafruit / ArduinoCore-samd

116 stars 119 forks source link

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

Open henrygab opened 4 years ago

henrygab commented 4 years ago

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