devanlai / dapboot

DFU Bootloader for STM32 chips
Other
331 stars 111 forks source link

Add attribute to avoid a warning by GCC #15

Closed 0x3333 closed 5 years ago

0x3333 commented 5 years ago

On dfu.c, in the STATE_DFU_IDLE we fall through, intentionally. This issues a warning on GCC:

dfu.c: In function 'dfu_control_class_request':
dfu.c:232:40: warning: this statement may fall through [-Wimplicit-fallthrough=]
                     current_dfu_offset = 0;
                     ~~~~~~~~~~~~~~~~~~~^~~
dfu.c:235:17: note: here
                 case STATE_DFU_UPLOAD_IDLE: {
                 ^~~~

GCC has an attribute to inform that this fall through is intentional, __attribute__ ((fallthrough)).

Will push a PR for this.