lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 13 Jul 2014 20:42:53 +0200
From:	Sam Ravnborg <sam@...nborg.org>
To:	Michal Marek <mmarek@...e.cz>,
	linux-kbuild <linux-kbuild@...r.kernel.org>
Cc:	lkml <linux-kernel@...r.kernel.org>,
	Thierry Reding <thierry.reding@...il.com>,
	Stephen Rothwell <sfr@...b.auug.org.au>,
	David Herrmann <dh.herrmann@...glemail.com>,
	Jiri Kosina <jkosina@...e.cz>, Sam Ravnborg <sam@...nborg.org>
Subject: [PATCH 5/6] samples: fix warnings in uhid-example

Fix following warnings seen when building using i686:
uhid-example.c: In function ‘uhid_write’:
uhid-example.c:168:4: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘ssize_t’ [-Wformat=]
uhid-example.c:168:4: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘unsigned int’ [-Wformat=]
uhid-example.c: In function ‘event’:
uhid-example.c:239:4: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘ssize_t’ [-Wformat=]
uhid-example.c:239:4: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘unsigned int’ [-Wformat=]

Use "%xd" for arguments of type size_t to fix the warnings.

Signed-off-by: Sam Ravnborg <sam@...nborg.org>
Cc: David Herrmann <dh.herrmann@...glemail.com>
Cc: Jiri Kosina <jkosina@...e.cz>
---
 samples/uhid/uhid-example.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/samples/uhid/uhid-example.c b/samples/uhid/uhid-example.c
index 7d58a4b..f25a5ef 100644
--- a/samples/uhid/uhid-example.c
+++ b/samples/uhid/uhid-example.c
@@ -164,7 +164,7 @@ static int uhid_write(int fd, const struct uhid_event *ev)
 		fprintf(stderr, "Cannot write to uhid: %m\n");
 		return -errno;
 	} else if (ret != sizeof(*ev)) {
-		fprintf(stderr, "Wrong size written to uhid: %ld != %lu\n",
+		fprintf(stderr, "Wrong size written to uhid: %zd != %zd\n",
 			ret, sizeof(ev));
 		return -EFAULT;
 	} else {
@@ -235,7 +235,7 @@ static int event(int fd)
 		fprintf(stderr, "Cannot read uhid-cdev: %m\n");
 		return -errno;
 	} else if (ret != sizeof(ev)) {
-		fprintf(stderr, "Invalid size read from uhid-dev: %ld != %lu\n",
+		fprintf(stderr, "Invalid size read from uhid-dev: %zd != %zd\n",
 			ret, sizeof(ev));
 		return -EFAULT;
 	}
-- 
1.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ