Skip to contentSkip to conversation

tools/xen-cpuid: Fix 32bit build

PATCH In review Andrew Cooper 2 participants 2 messages Nov 7, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/xen-cpuid: Fix 32bit build

Clang reports:

xen-cpuid.c:307:29: error: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat]

                 msrs[l].idx, msrs[l].val);
                              ^~~~~~~~~~~

Use PRIx64 instead.

---
CC: Ian Jackson <[email protected]>
CC: Wei Liu <[email protected]>

---
 tools/misc/xen-cpuid.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/misc/xen-cpuid.c +2 -1
index 2c41031..04b11d7 100644
@@ -5,6 +5,7 @@
 #include <string.h>
 #include <errno.h>
 #include <limits.h>
+#include <inttypes.h>
 
 #include <xenctrl.h>
 
@@ -303,7 +304,7 @@ static void print_policy(const char *name,
     printf(" MSRs:\n");
     printf("  %-8s -> %-16s\n", "index", "value");
     for ( l = 0; l < nr_msrs; ++l )
-        printf("  %08x -> %016lx\n",
+        printf("  %08x -> %016"PRIx64"\n",
                msrs[l].idx, msrs[l].val);
 }
 
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Andrew Cooper

Clang reports:

xen-cpuid.c:307:29: error: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat]

                 msrs[l].idx, msrs[l].val);
                              ^~~~~~~~~~~

Use PRIx64 instead.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel