cancel
Showing results for 
Search instead for 
Did you mean: 

Case statement fall through maintenance bug in usbd_cdc.c

Posted on June 06, 2018 at 20:38

cppcheck pointed out that usbd_cdc.c has a missing break statement around line 652.

The next case is a default:/break;, but if another case is inserted between the offender and the default, a fall through would happen.

Andrei

1 REPLY 1
Pavel A.
Evangelist III
Posted on June 08, 2018 at 01:14

A good catch.  By the way, ability to do

https://github.com/pavel-a/stm32f4_libs/blob/c4560650ddaea6ee33de171027d801a31109565a/STM32Cube_FW_F4/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc.c#L650

is one of reasons to put the STM32 libraries on GitHub. The recent news of Microsoft acquisition may scare some people away from GitHub... but there still are other git hosters  - Bitbucket, for one.