mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-13 18:04:40 +08:00

Use ip_addr_copy instead of ip_addr_set to avoid NULL test for &sntp_last_server_address. This fixes build warning when SNTP_CHECK_RESPONSE>=1 && LWIP_IPV4=1 && LWIP_IPV6=1. In file included from ../../../../lwip/src/include/lwip/apps/sntp.h:41:0, from ../../../../lwip/src/apps/sntp/sntp.c:52: ../../../../lwip/src/apps/sntp/sntp.c: In function ‘sntp_send_request’: ../../../../lwip/src/include/lwip/ip_addr.h:105:58: error: the comparison will always evaluate as ‘true’ for the address of ‘sntp_last_server_address’ will never be NULL [-Werror=address] #define IP_SET_TYPE(ipaddr, iptype) do { if((ipaddr) != NULL) { IP_SET_TYPE_VAL(*(ipaddr), iptype); }}while(0) ^ ../../../../lwip/src/include/lwip/ip_addr.h:157:36: note: in expansion of macro ‘IP_SET_TYPE’ #define ip_addr_set(dest, src) do{ IP_SET_TYPE(dest, IP_GET_TYPE(src)); if(IP_IS_V6(src)){ \ ^~~~~~~~~~~ ../../../../lwip/src/apps/sntp/sntp.c:549:5: note: in expansion of macro ‘ip_addr_set’ ip_addr_set(&sntp_last_server_address, server_addr); ^~~~~~~~~~~ Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: goldsimon <goldsimon@gmx.de>