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 -- [-Wuninitialized] #251

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

Build warnings -- [-Wuninitialized] #251

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/src/parsetools.h:
    In member function 'virtual void UniversalReportParser::Parse(HID*, uint32_t, uint32_t, uint8_t*)':

.../USBHost/src/parsetools.h:47:33:
    warning: '*((void*)(& prs)+4).MultiValueBuffer::valueSize' is used uninitialized in this function [-Wuninitialized]
   47 |   countDown = valueSize = pbuf->valueSize;
      |                           ~~~~~~^~~~~~~~~

-Wuninitialized information

GCC says the code will use uninitialized variables in at least some cases. That's bad, because it's much stronger than -Wmaybe-uninitialized.

Interpretation

Code will read from the specified location, and GCC believe it is will be uninitialized memory read from.

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