mirror of
https://git.yoctoproject.org/meta-security
synced 2026-05-07 04:58:47 +00:00
swtpm: fix compiler format warning
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 <patrick.ohly@intel.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
This commit is contained in:
committed by
Armin Kuster
parent
b70a046ce4
commit
8d0cc9b004
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user