summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2022-06-27 20:30:47 +0700
committerhathach <[email protected]>2022-06-27 20:30:47 +0700
commit9c56f7011171ff649a821fe87a3ee477299fa860 (patch)
treed0fdbecaae4bafddba344b24d2fec8da18f5f9b7
parentdd7a17c34511e79bc259634f4fa157e7ddf98fd1 (diff)
suppress error with net example
-rw-r--r--examples/device/net_lwip_webserver/CMakeLists.txt2
-rw-r--r--examples/make.mk3
-rw-r--r--src/class/net/ecm_rndis_device.c6
3 files changed, 7 insertions, 4 deletions
diff --git a/examples/device/net_lwip_webserver/CMakeLists.txt b/examples/device/net_lwip_webserver/CMakeLists.txt
index beaa9ad99..0f41b888a 100644
--- a/examples/device/net_lwip_webserver/CMakeLists.txt
+++ b/examples/device/net_lwip_webserver/CMakeLists.txt
@@ -76,6 +76,8 @@ if (EXISTS ${TOP}/lib/lwip/src)
target_compile_options(${PROJECT} PUBLIC
-Wno-error=null-dereference
-Wno-error=conversion
+ -Wno-error=sign-conversion
+ -Wno-error=sign-compare
)
# Configure compilation flags and libraries for the example... see the corresponding function
diff --git a/examples/make.mk b/examples/make.mk
index fa909ddca..27e1db38c 100644
--- a/examples/make.mk
+++ b/examples/make.mk
@@ -113,7 +113,8 @@ CFLAGS += \
-Wunused \
-Wredundant-decls
-# -Wconversion \
+# conversion is too strict for most mcu driver, may be disable sign/int/arith-conversion
+# -Wconversion
# Debugging/Optimization
ifeq ($(DEBUG), 1)
diff --git a/src/class/net/ecm_rndis_device.c b/src/class/net/ecm_rndis_device.c
index d85a3f778..5f316762f 100644
--- a/src/class/net/ecm_rndis_device.c
+++ b/src/class/net/ecm_rndis_device.c
@@ -318,11 +318,11 @@ bool netd_control_xfer_cb (uint8_t rhport, uint8_t stage, tusb_control_request_t
rndis_generic_msg_t *rndis_msg = (rndis_generic_msg_t *) ((void*) notify.rndis_buf);
uint32_t msglen = tu_le32toh(rndis_msg->MessageLength);
TU_ASSERT(msglen <= sizeof(notify.rndis_buf));
- tud_control_xfer(rhport, request, notify.rndis_buf, msglen);
+ tud_control_xfer(rhport, request, notify.rndis_buf, (uint16_t) msglen);
}
else
{
- tud_control_xfer(rhport, request, notify.rndis_buf, sizeof(notify.rndis_buf));
+ tud_control_xfer(rhport, request, notify.rndis_buf, (uint16_t) sizeof(notify.rndis_buf));
}
}
break;
@@ -369,7 +369,7 @@ static void handle_incoming_packet(uint32_t len)
}
}
- if (!tud_network_recv_cb(pnt, size))
+ if (!tud_network_recv_cb(pnt, (uint16_t) size))
{
/* if a buffer was never handled by user code, we must renew on the user's behalf */
tud_network_recv_renew();