[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [patch #9517] apps/sntp: Use ip_addr_copy to save server ad
From: |
Axel Lin |
Subject: |
[lwip-devel] [patch #9517] apps/sntp: Use ip_addr_copy to save server address |
Date: |
Fri, 15 Dec 2017 01:59:57 -0500 (EST) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36 |
URL:
<http://savannah.nongnu.org/patch/?9517>
Summary: apps/sntp: Use ip_addr_copy to save server address
Project: lwIP - A Lightweight TCP/IP stack
Submitted by: axellin
Submitted on: Fri 15 Dec 2017 06:59:55 AM UTC
Category: None
Priority: 5 - Normal
Status: None
Privacy: Public
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Planned Release: None
_______________________________________________________
Details:
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);
^~~~~~~~~~~
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Fri 15 Dec 2017 06:59:55 AM UTC Name:
0001-apps-sntp-Use-ip_addr_copy-to-save-server-address.patch Size: 2KiB By:
axellin
<http://savannah.nongnu.org/patch/download.php?file_id=42654>
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/patch/?9517>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
- [lwip-devel] [patch #9517] apps/sntp: Use ip_addr_copy to save server address,
Axel Lin <=