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 -- [-Wmaybe-uninitialized] #250

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

Build warnings -- [-Wmaybe-uninitialized] #250

henrygab opened this issue Aug 14, 2020 · 0 comments

Comments

@henrygab
Copy link

henrygab commented Aug 14, 2020

Note that this template is re-used across multiple classes. This may increase difficulty of avoiding regressions when fixing this issue.

Simplified log

.../USBHost/src/parsetools.h:
    In member function 'uint32_t HIDBoot<BOOT_PROTOCOL>::Init(uint32_t, uint32_t, uint32_t)
    [with unsigned char BOOT_PROTOCOL = 1]':

.../USBHost/src/parsetools.h:47:33:
    warning: '*((void*)(& confDescrParserB)+8).MultiValueBuffer::valueSize' may be used uninitialized in this function
    [-Wmaybe-uninitialized]
   47 |   countDown = valueSize = pbuf->valueSize;
      |                           ~~~~~~^~~~~~~~~

.../USBHost/src/parsetools.h:
    In member function 'uint32_t HIDBoot<BOOT_PROTOCOL>::Init(uint32_t, uint32_t, uint32_t)
    [with unsigned char BOOT_PROTOCOL = 2]':

.../USBHost/src/parsetools.h:47:33:
    warning: '*((void*)(& confDescrParserB)+8).MultiValueBuffer::valueSize' may be used uninitialized in this function
    [-Wmaybe-uninitialized]
   47 |   countDown = valueSize = pbuf->valueSize;
      |                           ~~~~~~^~~~~~~~~

.../USBHost/src/parsetools.h:
    In member function 'virtual uint32_t ADK::Init(uint32_t, uint32_t, uint32_t)':

.../USBHost/src/parsetools.h:47:33:
    warning: '*((void*)(& confDescrParser)+8).MultiValueBuffer::valueSize' may be used uninitialized in this function
    [-Wmaybe-uninitialized]
   47 |   countDown = valueSize = pbuf->valueSize;
      |                           ~~~~~~^~~~~~~~~

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

-Wmaybe-uninitialized information

The compiler believes (but cannot prove) that uninitialized memory is likely to be used.

Interpretation

tbd

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