]> xenbits.xensource.com Git - people/iwj/xen.git/commitdiff
tools/xen-cpuid: Fix 32bit build
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 7 Nov 2018 12:51:43 +0000 (12:51 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 7 Nov 2018 12:54:53 +0000 (12:54 +0000)
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.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
tools/misc/xen-cpuid.c

index 2c41031497675fd28a76a73ab2bd87311b9cf921..04b11d725013b6eb8da0e86548e052a9b7fe9d8a 100644 (file)
@@ -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);
 }