adafruit / Adafruit_TinyUSB_ArduinoCore

TinyUSB Core for Arduino
MIT License
21 stars 22 forks source link

if statement is always false #7

Closed henrygab closed 4 years ago

henrygab commented 4 years ago

https://github.com/adafruit/Adafruit_TinyUSB_ArduinoCore/blob/57244c13a72583c1b5a7f1e16cd8358c79d9e335/Adafruit_USBD_Device.cpp#L275

This is because the variable being checked is unsigned. The function declaration is for int8_t, so update this to also use the signed int8_t type.

hathach commented 4 years ago

my bad, this is a huge bug, thank you very much for spotting it out :smile:

henrygab commented 4 years ago

no problems ... I just compile with all warnings enabled ... all the time. It automatically points out these problems ... I am not finding these initial problems.

👍

hathach commented 4 years ago

no problems ... I just compile with all warnings enabled ... all the time. It automatically points out these problems ... I am not finding these initial problems.

Yeah, all warnings enabled is very handy, I does that as well with other project. Last time I tried with Arduino it throw out too many issues from 3rd party libraries, that is too annoying I have to off it. I will try to enable it again which helps catch potential issues.