Skip to content

Commit

Permalink
tools: fix 32 bit compile error
Browse files Browse the repository at this point in the history
```
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 <[email protected]>
  • Loading branch information
rustyrussell authored and ZmnSCPxj committed Jul 25, 2019
1 parent 5dee59e commit b1738c5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion devtools/print_wire.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion tools/test/enum.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit b1738c5

Please sign in to comment.