Skip to contentSkip to conversation

tools: libxl: Use correct printf format for uint64_t

PATCH In review Ian Campbell 3 participants 4 messages Jul 24, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools: libxl: Use correct printf format for uint64_t

Since 25652f232cbe "tools/libxl: detect and avoid conflicts with RDM" the build is broken for x86_32 and arm32 with:

libxl_dm.c: In function ‘libxl__domain_device_construct_rdm’:
libxl_dm.c:349:13: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 8 has type ‘uint64_t’ [-Werror=format=]

             LOG(ERROR, "RDM conflict at 0x%lx.\n", d_config->rdms[i].start);
             ^
libxl_dm.c:352:13: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 8 has type ‘uint64_t’ [-Werror=format=]
             LOG(WARN, "Ignoring RDM conflict at 0x%lx.\n",

Use PRIx64 for these.

---
 tools/libxl/libxl_dm.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
tools/libxl/libxl_dm.c +3 -2
index 8d103c3..8ac007a 100644
@@ -346,10 +346,11 @@ int libxl__domain_device_construct_rdm(libxl__gc *gc,
             continue;
 
         if (d_config->rdms[i].policy == LIBXL_RDM_RESERVE_POLICY_STRICT) {
-            LOG(ERROR, "RDM conflict at 0x%lx.\n", d_config->rdms[i].start);
+            LOG(ERROR, "RDM conflict at 0x%"PRIx64".\n",
+                       d_config->rdms[i].start);
             goto out;
         } else {
-            LOG(WARN, "Ignoring RDM conflict at 0x%lx.\n",
+            LOG(WARN, "Ignoring RDM conflict at 0x%"PRIx64".\n",
                       d_config->rdms[i].start);
 
             /*
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Acked-by on v1 1/1
#1 lore raw

Ian Campbell writes ("[PATCH] tools: libxl: Use correct printf format for uint64_t"):

Quoted 10 lines

Since 25652f232cbe "tools/libxl: detect and avoid conflicts with RDM" the build is broken for x86_32 and arm32 with:

libxl_dm.c: In function ‘libxl__domain_device_construct_rdm’:
libxl_dm.c:349:13: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 8 has type ‘uint64_t’ [-Werror=format=]

             LOG(ERROR, "RDM conflict at 0x%lx.\n", d_config->rdms[i].start);
             ^
libxl_dm.c:352:13: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 8 has type ‘uint64_t’ [-Werror=format=]
             LOG(WARN, "Ignoring RDM conflict at 0x%lx.\n",
Quoted 4 lines

Use PRIx64 for these.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

Acked-by on v1 1/1
#2 lore raw
In reply to Ian Campbell
Quoted 10 lines · Ian Campbell

Since 25652f232cbe "tools/libxl: detect and avoid conflicts with RDM" the build is broken for x86_32 and arm32 with:

libxl_dm.c: In function ‘libxl__domain_device_construct_rdm’:
libxl_dm.c:349:13: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 8 has type ‘uint64_t’ [-Werror=format=]

             LOG(ERROR, "RDM conflict at 0x%lx.\n", d_config->rdms[i].start);
             ^
libxl_dm.c:352:13: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 8 has type ‘uint64_t’ [-Werror=format=]
             LOG(WARN, "Ignoring RDM conflict at 0x%lx.\n",
Quoted 4 lines

Use PRIx64 for these.

Quoted 24 lines
---
 tools/libxl/libxl_dm.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
tools/libxl/libxl_dm.c +3 -2
index 8d103c3..8ac007a 100644
@@ -346,10 +346,11 @@ int libxl__domain_device_construct_rdm(libxl__gc *gc,
             continue;
 
         if (d_config->rdms[i].policy == LIBXL_RDM_RESERVE_POLICY_STRICT) {
-            LOG(ERROR, "RDM conflict at 0x%lx.\n", d_config->rdms[i].start);
+            LOG(ERROR, "RDM conflict at 0x%"PRIx64".\n",
+                       d_config->rdms[i].start);
             goto out;
         } else {
-            LOG(WARN, "Ignoring RDM conflict at 0x%lx.\n",
+            LOG(WARN, "Ignoring RDM conflict at 0x%"PRIx64".\n",
                       d_config->rdms[i].start);
 
             /*
Signature · 1 line
2.1.4

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

author Applied
#3 lore raw
Quoted 17 lines · Wei Liu
Quoted 16 lines · Ian Campbell

Since 25652f232cbe "tools/libxl: detect and avoid conflicts with RDM"
the build is broken for x86_32 and arm32 with:

libxl_dm.c: In function ‘libxl__domain_device_construct_rdm’:
libxl_dm.c:349:13: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 8 has type ‘uint64_t’ [ -Werror=format=]

             LOG(ERROR, "RDM conflict at 0x%lx.\n", d_config
->rdms[i].start);
             ^
libxl_dm.c:352:13: error: format ‘%lx’ expects argument of type 
‘long unsigned int’, but argument 8 has type ‘uint64_t’ [
-Werror=format=]
             LOG(WARN, "Ignoring RDM conflict at 0x%lx.\n",
Quoted 6 lines
Quoted 4 lines

Use PRIx64 for these.

Applied, thanks.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel