From 8d0cc9b00459438142d9a72fd85edce633c69da6 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Fri, 3 Feb 2017 09:46:11 +0100 Subject: swtpm: fix compiler format warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building for x86-64, gcc complains: tpm_ioctl.c:866:9: error: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘long unsigned int’ [-Werror=format=] | printf("ptm capability is 0x%llx\n", (uint64_t)devtoh64(is_chardev, cap)); | ^ | cc1: all warnings being treated as errors Casting to "long long unsigned" matches the format specifier in all cases, including those where "long long" is larger than 64 bits. Signed-off-by: Patrick Ohly Signed-off-by: Armin Kuster --- recipes-tpm/swtpm/files/fix_signed_issue.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-tpm/swtpm/files/fix_signed_issue.patch b/recipes-tpm/swtpm/files/fix_signed_issue.patch index 427df62..140585b 100644 --- a/recipes-tpm/swtpm/files/fix_signed_issue.patch +++ b/recipes-tpm/swtpm/files/fix_signed_issue.patch @@ -42,7 +42,7 @@ Index: git/src/swtpm_ioctl/tpm_ioctl.c } /* no tpm_result here */ - printf("ptm capability is 0x%lx\n", (uint64_t)devtoh64(is_chardev, cap)); -+ printf("ptm capability is 0x%llx\n", (uint64_t)devtoh64(is_chardev, cap)); ++ printf("ptm capability is 0x%llx\n", (long long unsigned)devtoh64(is_chardev, cap)); } else if (!strcmp(command, "-i")) { init.u.req.init_flags = htodev32(is_chardev, PTM_INIT_FLAG_DELETE_VOLATILE); -- cgit v1.2.3-54-g00ecf