Skip to content

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