Skip to content

Commit 19400c8

Browse files
committed
fix typo, add -Wno-error=unreachable-code for fuzz due to latest cdc changes
1 parent 6492f4a commit 19400c8

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

fuzz/device/net/src/fuzz.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,12 @@ void net_task(FuzzedDataProvider *provider) {
8888
case kNetworkCanXmit:
8989
(void)tud_network_can_xmit(provider->ConsumeIntegral<uint16_t>());
9090
case kNetworkXmit:
91-
// TODO: Actuall pass real values here later.
91+
// TODO: Actually pass real values here later.
9292
tud_network_xmit(NULL, 0);
9393

9494
case kMaxValue:
9595
// Noop.
9696
break;
9797
}
9898
}
99-
}
99+
}

fuzz/make.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ CFLAGS += \
7272
-O1
7373

7474
CFLAGS += \
75+
-Wno-error=unreachable-code \
7576
-DOPT_MCU_FUZZ=1 \
7677
-DCFG_TUSB_MCU=OPT_MCU_FUZZ
7778

src/class/cdc/cdc_device.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ uint32_t tud_cdc_n_write(uint8_t itf, void const* buffer, uint32_t bufsize)
171171
uint16_t ret = tu_fifo_write_n(&p_cdc->tx_ff, buffer, (uint16_t) bufsize);
172172

173173
// flush if queue more than packet size
174+
// may need to suppress -Wunreachable-code since most of the time CFG_TUD_CDC_TX_BUFSIZE < BULK_PACKET_SIZE
174175
if ( (tu_fifo_count(&p_cdc->tx_ff) >= BULK_PACKET_SIZE) || ((CFG_TUD_CDC_TX_BUFSIZE < BULK_PACKET_SIZE) && tu_fifo_full(&p_cdc->tx_ff)) )
175176
{
176177
tud_cdc_n_write_flush(itf);

0 commit comments

Comments
 (0)