Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Sep 2021 13:43:30 GMT
From:      Kristof Provost <kp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: a80a3afc3bfd - stable/13 - Fix -Wformat errors in pfctl on 32-bit architectures
Message-ID:  <202109061343.186DhUCc092600@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by kp:

URL: https://cgit.FreeBSD.org/src/commit/?id=a80a3afc3bfde2de6ca88b524ac1f5ab6f048aed

commit a80a3afc3bfde2de6ca88b524ac1f5ab6f048aed
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2021-08-29 15:31:28 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2021-09-06 13:42:53 +0000

    Fix -Wformat errors in pfctl on 32-bit architectures
    
    Use PRIu64 to printf(3) uint64_t quantities, otherwise this will result
    in "error: format specifies type 'unsigned long' but the argument has
    type 'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat]" on 32-bit
    architectures.
    
    Fixes:          80078d9d38fd
    MFC after:      1 week
    
    (cherry picked from commit 5b8f07b12f8477f1679013d6b3abdab8d33c7243)
---
 sbin/pfctl/pfctl_parser.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c
index e9a227630f28..9f955a8b1c96 100644
--- a/sbin/pfctl/pfctl_parser.c
+++ b/sbin/pfctl/pfctl_parser.c
@@ -578,7 +578,7 @@ print_status(struct pfctl_status *s, struct pfctl_syncookies *cookies, int opts)
 	printf("%-27s %14s %16s\n", "State Table", "Total", "Rate");
 	printf("  %-25s %14" PRIu64 " %14s\n", "current entries", s->states, "");
 	TAILQ_FOREACH(c, &s->fcounters, entry) {
-		printf("  %-25s %14lu ", c->name, c->counter);
+		printf("  %-25s %14" PRIu64 " ", c->name, c->counter);
 		if (runtime > 0)
 			printf("%14.1f/s\n",
 			    (double)c->counter / (double)runtime);
@@ -590,7 +590,7 @@ print_status(struct pfctl_status *s, struct pfctl_syncookies *cookies, int opts)
 		printf("  %-25s %14" PRIu64 " %14s\n", "current entries",
 		    s->src_nodes, "");
 		TAILQ_FOREACH(c, &s->scounters, entry) {
-			printf("  %-25s %14lu ", c->name, c->counter);
+			printf("  %-25s %14" PRIu64 " ", c->name, c->counter);
 			if (runtime > 0)
 				printf("%14.1f/s\n",
 				    (double)c->counter / (double)runtime);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202109061343.186DhUCc092600>