From 9a5b31c37bd5b55e8dc79d894f19aedd503c373c Mon Sep 17 00:00:00 2001 From: Gareth McMullin Date: Mon, 9 Oct 2017 11:07:29 +1300 Subject: [PATCH] Fix fallthrough warnings on gcc 7 --- src/gdb_main.c | 5 ++--- src/platforms/common/cdcacm.c | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gdb_main.c b/src/gdb_main.c index 1a5805af..ed1f2fe0 100644 --- a/src/gdb_main.c +++ b/src/gdb_main.c @@ -155,7 +155,7 @@ int gdb_main_loop(struct target_controller *tc, bool in_syscall) } case 's': /* 's [addr]': Single step [start at addr] */ single_step = true; - // Fall through to resume target + /* fall through */ case 'c': /* 'c [addr]': Continue [at addr] */ if(!cur_target) { gdb_putpacketz("X1D"); @@ -165,7 +165,7 @@ int gdb_main_loop(struct target_controller *tc, bool in_syscall) target_halt_resume(cur_target, single_step); SET_RUN_STATE(1); single_step = false; - // Fall through to wait for target halt + /* fall through */ case '?': { /* '?': Request reason for target halt */ /* This packet isn't documented as being mandatory, * but GDB doesn't work without it. */ @@ -482,4 +482,3 @@ void gdb_main(void) { gdb_main_loop(&gdb_controller, false); } - diff --git a/src/platforms/common/cdcacm.c b/src/platforms/common/cdcacm.c index 5974cd4a..62cc419b 100644 --- a/src/platforms/common/cdcacm.c +++ b/src/platforms/common/cdcacm.c @@ -445,6 +445,7 @@ static int cdcacm_control_request(usbd_device *dev, switch(req->wIndex) { case 2: usbuart_set_line_coding((struct usb_cdc_line_coding*)*buf); + return 1; case 0: return 1; /* Ignore on GDB Port */ default: @@ -462,6 +463,7 @@ static int cdcacm_control_request(usbd_device *dev, return 1; } + return 0; case DFU_DETACH: if(req->wIndex == DFU_IF_NO) { *complete = dfu_detach_complete; @@ -561,4 +563,3 @@ void USB_ISR(void) { usbd_poll(usbdev); } -