Commit 0bbc65b
committed
nfctool: Fix builds on 32-bit ARM with __USE_TIME64_REDIRECTS
tv_sec and tv_usec might be long or long long, depending on
__USE_TIME64_REDIRECTS. 32-bit ARM Debian builds apparently defined it
as long long, so they failed:
tools/nfctool/llcp-decode.c: In function 'llcp_print_pdu':
tools/nfctool/llcp-decode.c:553:41: error: format '%ld' expects argument of type 'long int', but argument 4 has type '__time64_t' {aka 'long long int'} [-Werror=format=]
553 | sprintf(time_str, "%c%ld.%06lds", prefix, msg_timestamp.tv_sec,
| ~~^ ~~~~~~~~~~~~~~~~~~~~
| | |
| long int __time64_t {aka long long int}
| %lld
tools/nfctool/llcp-decode.c:553:47: error: format '%ld' expects argument of type 'long int', but argument 5 has type '__suseconds64_t' {aka 'long long int'} [-Werror=format=]
553 | sprintf(time_str, "%c%ld.%06lds", prefix, msg_timestamp.tv_sec,
| ~~~~^
| |
| long int
| %06lld
554 | msg_timestamp.tv_usec);
| ~~~~~~~~~~~~~~~~~~~~~
| |
| __suseconds64_t {aka long long int}
Let's just cast this to long long, so same code will work fine for both
platforms.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>1 parent 661a9fb commit 0bbc65b
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
550 | 550 | | |
551 | 551 | | |
552 | 552 | | |
553 | | - | |
554 | | - | |
| 553 | + | |
| 554 | + | |
555 | 555 | | |
556 | 556 | | |
557 | 557 | | |
| |||
0 commit comments