Skip to content

tinyusb: Avoid compilation warnings #169

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

Merged
merged 1 commit into from
Aug 26, 2019
Merged

tinyusb: Avoid compilation warnings #169

merged 1 commit into from
Aug 26, 2019

Conversation

kaysievers
Copy link

TinyUSB adds new warnings to the compilation process. Operations
inside of {} initializers get propagated to 'int' but get assigned
to uint8_t.

Add static casts to to uint8_t to avoid a bunch of warnings like this:
cores/arduino/Adafruit_TinyUSB_Core/Adafruit_USBD_CDC.cpp: In member function
'virtual uint16_t Adafruit_USBD_CDC::getDescriptor(uint8_t, uint8_t*, uint16_t)':
cores/arduino/Adafruit_TinyUSB_Core/tinyusb/src/device/usbd.h:172:74: warning:
narrowing conversion of '(((int)itfnum) + 1)' from 'int' to 'uint8_t
{aka unsigned char}' inside { } [-Wnarrowing]
5, TUSB_DESC_CS_INTERFACE, CDC_FUNC_DESC_CALL_MANAGEMENT, 0, (_itfnum) + 1,\

TinyUSB adds new warnings to the compilation process. Operations
inside of {} initializers get propagated to 'int' but get assigned
to uint8_t.

Add static casts to to uint8_t to avoid a bunch of warnings like this:
  cores/arduino/Adafruit_TinyUSB_Core/Adafruit_USBD_CDC.cpp: In member function
  'virtual uint16_t Adafruit_USBD_CDC::getDescriptor(uint8_t, uint8_t*, uint16_t)':
  cores/arduino/Adafruit_TinyUSB_Core/tinyusb/src/device/usbd.h:172:74: warning:
  narrowing conversion of '(((int)itfnum) + 1)' from 'int' to 'uint8_t
  {aka unsigned char}' inside { } [-Wnarrowing]
     5, TUSB_DESC_CS_INTERFACE, CDC_FUNC_DESC_CALL_MANAGEMENT, 0, (_itfnum) + 1,\
@ladyada ladyada requested a review from hathach August 25, 2019 03:00
Copy link
Member

@hathach hathach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the PR

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

Successfully merging this pull request may close these issues.

2 participants