[Git][NTPsec/ntpsec][master] Banish GCC 6 warnings.

Eric S. Raymond gitlab at mg.gitlab.com
Thu Oct 5 21:50:02 UTC 2017


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
ee6f51e6 by Eric S. Raymond at 2017-10-05T17:49:53-04:00
Banish GCC 6 warnings.

- - - - -


3 changed files:

- ntpd/ntp_io.c
- ntpd/ntp_monitor.c
- ntpd/ntp_proto.c


Changes:

=====================================
ntpd/ntp_io.c
=====================================
--- a/ntpd/ntp_io.c
+++ b/ntpd/ntp_io.c
@@ -2332,9 +2332,9 @@ read_network_packet(
 	rb->recv_length = (size_t)buflen;
 
 	if (buflen == 0 || (buflen == -1 &&
-	    (EWOULDBLOCK == errno
+			    ((EWOULDBLOCK == errno)
 #ifdef EAGAIN
-	     || EAGAIN == errno
+			     || (EAGAIN == errno)
 #endif
 	     ))) {
 		freerecvbuf(rb);


=====================================
ntpd/ntp_monitor.c
=====================================
--- a/ntpd/ntp_monitor.c
+++ b/ntpd/ntp_monitor.c
@@ -473,6 +473,7 @@ ntp_monitor(
 	/*
 	 * Got one, initialize it
 	 */
+	REQUIRE(mon != NULL);
 	mru_entries++;
 	mru_peakentries = max(mru_peakentries, mru_entries);
 	mon->last = rbufp->recv_time;


=====================================
ntpd/ntp_proto.c
=====================================
--- a/ntpd/ntp_proto.c
+++ b/ntpd/ntp_proto.c
@@ -275,6 +275,7 @@ parse_packet(
 	}
 
 	struct parsed_pkt *pkt = calloc(1, sizeof (struct parsed_pkt));
+	uint8_t const* bufptr = recv_buf + LEN_PKT_NOMAC;
 
 	if(pkt == NULL) { goto fail; }
 
@@ -299,8 +300,6 @@ parse_packet(
 	pkt->keyid = 0;
 	pkt->mac_len = 0;
 
-	uint8_t const* bufptr = recv_buf + LEN_PKT_NOMAC;
-
 	if(PKT_VERSION(pkt->li_vn_mode) > 4) {
 		/* Unsupported version */
 		goto fail;



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/ee6f51e622b7f0c2e5f41e394a2026d58fe1b361

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/ee6f51e622b7f0c2e5f41e394a2026d58fe1b361
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20171005/4e2cee52/attachment.html>


More information about the vc mailing list