Skip to contentSkip to conversation

xsm: fix clang build

PATCH In review Roger Pau Monne 3 participants 3 messages Sep 5, 2018 – Sep 7, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xsm: fix clang build

ebitmap.c:244:32: error: invalid conversion specifier 'Z' [-Werror,-Wformat-invalid-specifier]
"match my size %Zd (high bit was %d)\n", mapunit,
~^
ebitmap.c:245:16: error: format specifies type 'int' but the argument has type 'unsigned long'

      [-Werror,-Wformat]
               sizeof(u64) * 8, e->highbit);
               ^~~~~~~~~~~~~~~
ebitmap.c:245:33: error: data argument not used by format string [-Werror,-Wformat-extra-args]
               sizeof(u64) * 8, e->highbit);

Use %zd instead of %Zd, which is compliant with C99.

---
Cc: Daniel De Graaf <[email protected]>

---
 xen/xsm/flask/ss/ebitmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/xsm/flask/ss/ebitmap.c +1 -1
index bb3ec8e7c9..e1d0a586a7 100644
@@ -241,7 +241,7 @@ int ebitmap_read(struct ebitmap *e, void *fp)
     if ( mapunit != sizeof(u64) * 8 )
     {
         printk(KERN_ERR "Flask: ebitmap: map size %u does not "
-               "match my size %Zd (high bit was %d)\n", mapunit,
+               "match my size %zd (high bit was %d)\n", mapunit,
                sizeof(u64) * 8, e->highbit);
         goto bad;
     }
Signature · 7 lines
2.18.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Roger Pau Monne

ebitmap.c:244:32: error: invalid conversion specifier 'Z' [-Werror,-Wformat-invalid-specifier]
"match my size %Zd (high bit was %d)\n", mapunit,
~^
ebitmap.c:245:16: error: format specifies type 'int' but the argument has type 'unsigned long'

      [-Werror,-Wformat]
               sizeof(u64) * 8, e->highbit);
               ^~~~~~~~~~~~~~~
ebitmap.c:245:33: error: data argument not used by format string [-Werror,-Wformat-extra-args]
               sizeof(u64) * 8, e->highbit);
Quoted 3 lines

Use %zd instead of %Zd, which is compliant with C99.

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

Acked-by Daniel De Graaf on v1 1/1
#2 lore raw
In reply to Roger Pau Monne
Quoted 17 lines

-----Original Message-----
From: Roger Pau Monne <[email protected]>
Sent: Wednesday, September 5, 2018 10:46 AM
To: [email protected]
Cc: Roger Pau Monne <[email protected]>; Daniel De Graaf <[email protected]>
Subject: [Non-DoD Source] [PATCH] xsm: fix clang build

ebitmap.c:244:32: error: invalid conversion specifier 'Z' [-Werror,-Wformat-invalid-specifier]
"match my size %Zd (high bit was %d)\n", mapunit,
~^
ebitmap.c:245:16: error: format specifies type 'int' but the argument has type 'unsigned long'

      [-Werror,-Wformat]
               sizeof(u64) * 8, e->highbit);
               ^~~~~~~~~~~~~~~
ebitmap.c:245:33: error: data argument not used by format string [-Werror,-Wformat-extra-args]
               sizeof(u64) * 8, e->highbit);
Quoted 3 lines

Use %zd instead of %Zd, which is compliant with C99.

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