[Git][NTPsec/ntpsec][master] 4 commits: ntp_proto: fix bad format signedness

Gary E. Miller gitlab at mg.gitlab.com
Fri Apr 14 17:59:52 UTC 2017


Gary E. Miller pushed to branch master at NTPsec / ntpsec


Commits:
12af50ea by Gary E. Miller at 2017-04-14T10:43:01-07:00
ntp_proto: fix bad format signedness

- - - - -
64c1272f by Gary E. Miller at 2017-04-14T10:44:39-07:00
ntp_proto: convert implicit cast to explicit.

- - - - -
7284f3c3 by Gary E. Miller at 2017-04-14T10:46:19-07:00
ntp_proto: fix format signedness issue

- - - - -
19f0e93d by Gary E. Miller at 2017-04-14T10:52:12-07:00
waf: use -Wdisabled-optimization and -Wformat-security by default

Only if available.

- - - - -


2 changed files:

- ntpd/ntp_proto.c
- wafhelpers/configure.py


Changes:

=====================================
ntpd/ntp_proto.c
=====================================
--- a/ntpd/ntp_proto.c
+++ b/ntpd/ntp_proto.c
@@ -2440,17 +2440,17 @@ msyslog(LOG_INFO, "Server trying: %s", socktoa(rmtadr));
 		server->dstadr = findinterface(rmtadr);
 if (NULL == server->dstadr)
   msyslog(LOG_ERR, "server_take_dns: can't find interface for %s", server->hostname);
-		server->flags &= ~FLAG_DNS;
+		server->flags &= (unsigned)~FLAG_DNS;
 		server->hpoll = server->minpoll;
 		server->nextdate = current_time;
 		peer_update_hash(server);
 		peer_xmit(server);
 
 #ifdef HAL_FIXED
-		DPRINTF(1, ("transmit: at %ld %s->%s pool\n",
+		DPRINTF(1, ("transmit: at %lu %s->%s pool\n",
 		    current_time, latoa(lcladr), socktoa(rmtadr)));
 #else
-		DPRINTF(1, ("transmit: at %ld ->%s pool\n",
+		DPRINTF(1, ("transmit: at %lu ->%s pool\n",
 		    current_time, socktoa(rmtadr)));
 #endif
 		msyslog(LOG_INFO, "Setup server %s", socktoa(rmtadr));
@@ -2504,7 +2504,7 @@ msyslog(LOG_INFO, "Pool trying: %s", socktoa(rmtadr));
 		pool->sent++;
 		pool->throttle += (1 << pool->minpoll) - 2;
 
-		DPRINTF(1, ("transmit: at %ld %s->%s pool\n",
+		DPRINTF(1, ("transmit: at %lu %s->%s pool\n",
 		    current_time, latoa(lcladr), socktoa(rmtadr)));
 		msyslog(LOG_INFO, "Soliciting pool server %s", socktoa(rmtadr));
 	};


=====================================
wafhelpers/configure.py
=====================================
--- a/wafhelpers/configure.py
+++ b/wafhelpers/configure.py
@@ -260,8 +260,9 @@ def cmd_configure(ctx, config):
         ('unused', '-Qunused-arguments'),
         ('w_cast_align', "-Wcast-align"),
         ('w_cast_qual', "-Wcast-qual"),
-        ('w_disabled_optimizaation', "-Wdisabled-optimization"),
+        ('w_disabled_optimization', "-Wdisabled-optimization"),
         ('w_format', '-Wformat'),
+        ('w_format_security', '-Wformat-security'),
         # fails on OpenBSD 6
         ('w_format_signedness', '-Wformat-signedness'),
         ('w_implicit_function_declaration', "-Wimplicit-function-declaration"),
@@ -301,10 +302,8 @@ def cmd_configure(ctx, config):
             #"-Wsuggest-attribute=const", # fails build
             #"-Waggregate-return",    # breaks ldiv(), ntpcal_daysplit(),  etc.
             "-Wbad-function-cast",
-            "-Wdisabled-optimization",
             "-Wfloat-equal",          # Not Ready For Prime Time
             "-Wformat-nonliteral",    # needs -Wformat
-            "-Wformat-security",      # needs -Wformat
             "-Wmissing-declarations", # Not Ready For Prime Time
             "-Wmissing-format-attribute",
             # "-Wnested-externs",     # incompatible w/ Unity...
@@ -381,8 +380,11 @@ int main(int argc, char **argv) {
         ctx.env.CFLAGS = ["-flto"] + ctx.env.CFLAGS
 
     # debug warnings that are not available with all compilers
+    if ctx.env.HAS_w_format_security:
+        ctx.env.CFLAGS = ['-Wformat-security'] + ctx.env.CFLAGS
     if ctx.env.HAS_w_format_signedness:
         ctx.env.CFLAGS = ['-Wformat-signedness'] + ctx.env.CFLAGS
+    # should be before other -Wformat-* in CFLAGS
     if ctx.env.HAS_w_format:
         ctx.env.CFLAGS = ['-Wformat'] + ctx.env.CFLAGS
     if ctx.env.HAS_w_init_self:



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/61980b1b36dc1f36018a9c18009544882ab7ffc0...19f0e93df84f508a5a6c04544a01d48f5e57b24e

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/61980b1b36dc1f36018a9c18009544882ab7ffc0...19f0e93df84f508a5a6c04544a01d48f5e57b24e
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/20170414/ddba87bd/attachment.html>


More information about the vc mailing list