diff options
| author | hathach <[email protected]> | 2022-06-27 21:05:41 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2022-06-27 21:05:41 +0700 |
| commit | 25580b4fe9acd1d9f9f12cbfdd29037669376a8d (patch) | |
| tree | 9f5f38d56a120446637c20f3bb749f1a40251f85 | |
| parent | 9c56f7011171ff649a821fe87a3ee477299fa860 (diff) | |
use forloop to avoid -Warray-bounds with host setup packet
| -rw-r--r-- | src/portable/raspberrypi/rp2040/hcd_rp2040.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/portable/raspberrypi/rp2040/hcd_rp2040.c b/src/portable/raspberrypi/rp2040/hcd_rp2040.c index 13e7778ea..e9118c6a3 100644 --- a/src/portable/raspberrypi/rp2040/hcd_rp2040.c +++ b/src/portable/raspberrypi/rp2040/hcd_rp2040.c @@ -563,11 +563,10 @@ bool hcd_setup_send(uint8_t rhport, uint8_t dev_addr, uint8_t const setup_packet (void) rhport; // Copy data into setup packet buffer -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Warray-bounds" -#pragma GCC diagnostic ignored "-Wstringop-overflow" - memcpy((void*) (uintptr_t) &usbh_dpram->setup_packet[0], setup_packet, 8); -#pragma GCC diagnostic pop + for(uint8_t i=0; i<8; i++) + { + usbh_dpram->setup_packet[i] = setup_packet[i]; + } // Configure EP0 struct with setup info for the trans complete struct hw_endpoint *ep = _hw_endpoint_allocate(0); |
