Skip to content

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

Open
@henrygab

Description

@henrygab

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions