From 2f098c42a7e7218a3cf6ce41cadc1aa1cfeede83 Mon Sep 17 00:00:00 2001 From: Jacob Kroon Date: Tue, 1 Jan 2019 20:08:24 +0100 Subject: [PATCH] Fix compile of UDP unit test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix building unit tests via contrib/ports/unix/check on Debian 9, gcc 6.3.0. Fixes: /ip_addr.h:105:58: error: the comparison will always evaluate as ‘true’ for the address of ‘ip1’ will never be NULL [-Werror=address] #define IP_SET_TYPE(ipaddr, iptype) do { if((ipaddr) != NULL) { IP_SET_TYPE_VAL(*(ipaddr),iptype); }}while(0) Signed-off-by: Jacob Kroon --- test/unit/udp/test_udp.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/unit/udp/test_udp.c b/test/unit/udp/test_udp.c index 6ea1f197..56e14b81 100644 --- a/test/unit/udp/test_udp.c +++ b/test/unit/udp/test_udp.c @@ -346,8 +346,8 @@ START_TEST(test_udp_bind) LWIP_UNUSED_ARG(_i); /* bind on same port using different IP address types */ - ip_addr_set_any(0, &ip1); - ip_addr_set_any(1, &ip2); + ip_addr_set_any_val(0, ip1); + ip_addr_set_any_val(1, ip2); pcb1 = udp_new_ip_type(IPADDR_TYPE_V4); pcb2 = udp_new_ip_type(IPADDR_TYPE_V6); @@ -362,8 +362,8 @@ START_TEST(test_udp_bind) udp_remove(pcb2); /* bind on same port using SAME IPv4 address type */ - ip_addr_set_any(0, &ip1); - ip_addr_set_any(0, &ip2); + ip_addr_set_any_val(0, ip1); + ip_addr_set_any_val(0, ip2); pcb1 = udp_new_ip_type(IPADDR_TYPE_V4); pcb2 = udp_new_ip_type(IPADDR_TYPE_V4); @@ -378,8 +378,8 @@ START_TEST(test_udp_bind) udp_remove(pcb2); /* bind on same port using SAME IPv4 address type */ - ip_addr_set_any(1, &ip1); - ip_addr_set_any(1, &ip2); + ip_addr_set_any_val(1, ip1); + ip_addr_set_any_val(1, ip2); pcb1 = udp_new_ip_type(IPADDR_TYPE_V6); pcb2 = udp_new_ip_type(IPADDR_TYPE_V6); @@ -394,8 +394,8 @@ START_TEST(test_udp_bind) udp_remove(pcb2); /* Bind with different IP address type */ - ip_addr_set_any(0, &ip1); - ip_addr_set_any(1, &ip2); + ip_addr_set_any_val(0, ip1); + ip_addr_set_any_val(1, ip2); pcb1 = udp_new_ip_type(IPADDR_TYPE_V6); pcb2 = udp_new_ip_type(IPADDR_TYPE_V4);