From 1dc73f99dc2981dabe58eda632dd8d35fe19fe3d Mon Sep 17 00:00:00 2001 From: dim Date: Mon, 19 Mar 2012 19:17:55 +0000 Subject: Fix the following warning from clang trunk: usr.sbin/dconschat/dconschat.c:163:65: error: format specifies type 'size_t' (aka 'unsigned int') but the argument has type 'off_t' (aka 'long long') [-Werror,-Wformat] snprintf(buf, PAGE_SIZE, "\r\n[dconschat reset target(addr=0x%zx)...]\r\n", dc->reset); ~~^ ~~~~~~~~~ %llx Silence this by casting dc->reset to intmax_t, and using the appropriate length modifier. While here, wrap the line to a 80 character margin. MFC after: 3 days --- usr.sbin/dconschat/dconschat.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'usr.sbin/dconschat') diff --git a/usr.sbin/dconschat/dconschat.c b/usr.sbin/dconschat/dconschat.c index 9246181..af35e01 100644 --- a/usr.sbin/dconschat/dconschat.c +++ b/usr.sbin/dconschat/dconschat.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -160,7 +161,9 @@ dconschat_reset_target(struct dcons_state *dc, struct dcons_port *p) if (dc->reset == 0) return; - snprintf(buf, PAGE_SIZE, "\r\n[dconschat reset target(addr=0x%zx)...]\r\n", dc->reset); + snprintf(buf, PAGE_SIZE, + "\r\n[dconschat reset target(addr=0x%jx)...]\r\n", + (intmax_t)dc->reset); write(p->outfd, buf, strlen(buf)); bzero(&buf[0], PAGE_SIZE); dwrite(dc, (void *)buf, PAGE_SIZE, dc->reset); -- cgit v1.1