From b1738c5b899d9b46562de676897004e95597ebdc Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 25 Jul 2019 11:49:21 +0930 Subject: [PATCH] tools: fix 32 bit compile error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` tools/test/enum.c: In function ‘fromwire_test_enum’: tools/test/enum.c:11:34: error: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘size_t {aka unsigned int}’ [-Werror=format=] printf("fromwire_test_enum at %ld\n", *max); ``` and: ``` devtools/print_wire.c: In function ‘printwire_tlvs’: devtools/print_wire.c:201:22: error: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘u64 {aka long long unsigned int}’ [-Werror=format=] printf("**TYPE #%ld UNKNOWN for TLV %s**\n", type, fieldname); ^ ``` Signed-off-by: Rusty Russell --- devtools/print_wire.c | 2 +- tools/test/enum.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/devtools/print_wire.c b/devtools/print_wire.c index e0c68a0ef..675fe458f 100644 --- a/devtools/print_wire.c +++ b/devtools/print_wire.c @@ -198,7 +198,7 @@ void printwire_tlvs(const char *fieldname, const u8 **cursor, size_t *plen, printf("}\n"); *plen -= length; } else - printf("**TYPE #%ld UNKNOWN for TLV %s**\n", type, fieldname); + printf("**TYPE #%"PRIu64" UNKNOWN for TLV %s**\n", type, fieldname); } return; diff --git a/tools/test/enum.c b/tools/test/enum.c index 67cef3c22..df77744bc 100644 --- a/tools/test/enum.c +++ b/tools/test/enum.c @@ -8,7 +8,7 @@ void towire_test_enum(u8 **pptr, const enum test_enum test_enum) enum test_enum fromwire_test_enum(const u8 **cursor, size_t *max) { - printf("fromwire_test_enum at %ld\n", *max); + printf("fromwire_test_enum at %zu\n", *max); return TEST_ONE; }