Explorar o código

tcp: fix compiling with LWIP_NOASSERT

See bug #64734
Simon Goldschmidt %!s(int64=2) %!d(string=hai) anos
pai
achega
ae5a5b99eb
Modificáronse 2 ficheiros con 4 adicións e 0 borrados
  1. 1 0
      contrib/examples/tftp/tftp_example.c
  2. 3 0
      src/core/tcp_out.c

+ 1 - 0
contrib/examples/tftp/tftp_example.c

@@ -141,6 +141,7 @@ tftp_example_init_client(void)
   ip_addr_t srv;
   int ret = ipaddr_aton(LWIP_TFTP_EXAMPLE_CLIENT_REMOTEIP, &srv);
   LWIP_ASSERT("ipaddr_aton failed", ret == 1);
+  LWIP_UNUSED_ARG(ret);
 
   err = tftp_init_client(&tftp);
   LWIP_ASSERT("tftp_init_client failed", err == ERR_OK);

+ 3 - 0
src/core/tcp_out.c

@@ -1987,6 +1987,9 @@ tcp_rst_common(const struct tcp_pcb *pcb, u32_t seqno, u32_t ackno,
 
   LWIP_ASSERT("tcp_rst: invalid local_ip", local_ip != NULL);
   LWIP_ASSERT("tcp_rst: invalid remote_ip", remote_ip != NULL);
+  /* these two are passed only for checks, disable warnings without asserts */
+  LWIP_UNUSED_ARG(local_ip);
+  LWIP_UNUSED_ARG(remote_ip);
 
   optlen = LWIP_TCP_OPT_LENGTH_SEGMENT(0, pcb);