diff options
author | David Howells <dhowells@redhat.com> | 2011-07-26 10:31:15 +0100 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2011-07-26 10:31:15 +0100 |
commit | 502a514f567e25092c070d225bd68a3587299e2d (patch) | |
tree | c61b8a970e237602b4aed64fc02fb1b6f846ab4a | |
parent | 3e38024f87050e1fc31c9e34d89219edb4839255 (diff) | |
download | keyutils-502a514f567e25092c070d225bd68a3587299e2d.tar.gz |
Use ptrdiff_t format spec in printf for pointer subtraction results
Use ptrdiff_t format spec ("%td") in printf when displaying a pointer
subtraction result rather than a size_t ("%zu") or ssize_t ("%zd") format spec
as on something like the S390 pointers are not the same size as size_t,
resulting in the following warnings:
request-key.c: In function 'execute_program':
request-key.c:583:4: error: format '%zd' expects argument of type 'signed size_t', but argument 2 has type 'int' [-Werror=format]
request-key.c: In function 'pipe_to_program':
request-key.c:841:2: error: format '%zd' expects argument of type 'signed size_t', but argument 2 has type 'int' [-Werror=format]
Signed-off-by: David Howells <dhowells@redhat.com>
-rw-r--r-- | keyutils.spec | 5 | ||||
-rw-r--r-- | request-key.c | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/keyutils.spec b/keyutils.spec index 1f402e9..fcb859a 100644 --- a/keyutils.spec +++ b/keyutils.spec @@ -9,7 +9,7 @@ Summary: Linux Key Management Utilities Name: keyutils Version: %{version} -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ and LGPLv2+ Group: System Environment/Base ExclusiveOS: Linux @@ -92,6 +92,9 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man3/* %changelog +* Tue Jul 26 2011 David Howells <dhowells@redhat.com> - 1.5.1-2 +- Use correct format spec for printing pointer subtraction results. + * Tue Jul 19 2011 David Howells <dhowells@redhat.com> - 1.5.1-1 - Fix unread variables. - Licence file update. diff --git a/request-key.c b/request-key.c index 4624423..4d07129 100644 --- a/request-key.c +++ b/request-key.c @@ -580,7 +580,7 @@ static void execute_program(char *op, debug("%s %s\n", pipeit ? "PipeThru" : "Run", prog); for (ap = argv; *ap; ap++) - debug("- argv[%zd] = \"%s\"\n", ap - argv, *ap); + debug("- argv[%td] = \"%s\"\n", ap - argv, *ap); } /* become the same UID/GID as the key requesting process */ @@ -838,7 +838,7 @@ static void pipe_to_program(char *op, } /* attempt to instantiate the key */ - debug("instantiate with %zd bytes\n", pp - payload); + debug("instantiate with %td bytes\n", pp - payload); if (keyctl_instantiate(key, payload, pp - payload, 0) < 0) error("instantiate key failed: %m\n"); |