diff options
author | Dmitry V. Levin <ldv@strace.io> | 2022-10-02 08:00:00 +0000 |
---|---|---|
committer | Dmitry V. Levin <ldv@strace.io> | 2022-10-02 08:00:00 +0000 |
commit | bea08712a5d8128a7ed17145835110ff45027220 (patch) | |
tree | 1f585574fb89ad86d8fd3e42c65ba022ee0959be | |
parent | 930c77c50ed4e7554bcf9904045b058e731e1508 (diff) | |
download | strace-bea08712a5d8128a7ed17145835110ff45027220.tar.gz |
tests: fix build on some platforms
This fixes the following compilation issues on platforms
where __s64 is not defined to "long long":
ioctl_ptp.c:268:11: error: format '%lld' expects argument of type 'long long int', but argument 4 has type '__s64' {aka 'long int'} [-Werror=format=]
ioctl_ptp.c:268:11: error: format '%lld' expects argument of type 'long long int', but argument 5 has type '__s64' {aka 'long int'} [-Werror=format=]
ioctl_ptp.c:355:24: error: format '%lld' expects argument of type 'long long int', but argument 3 has type '__s64' {aka 'long int'} [-Werror=format=]
ioctl_ptp.c:490:29: error: format '%lld' expects argument of type 'long long int', but argument 2 has type '__s64' {aka 'const long int'} [-Werror=format=]
ioctl_ptp.c:498:36: error: format '%lld' expects argument of type 'long long int', but argument 2 has type '__s64' {aka 'const long int'} [-Werror=format=]
ioctl_ptp.c:509:35: error: format '%lld' expects argument of type 'long long int', but argument 2 has type '__s64' {aka 'const long int'} [-Werror=format=]
ioctl_ptp.c:581:25: error: format '%lld' expects argument of type 'long long int', but argument 3 has type '__s64' {aka 'long int'} [-Werror=format=]
* tests/ioctl_ptp.c (test_no_device): Explicitly cast
struct ptp_clock_time.sec to "long long".
Fixes: v5.19-5-g03eb34004 "ptp: update decoder"
-rw-r--r-- | tests/ioctl_ptp.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/ioctl_ptp.c b/tests/ioctl_ptp.c index f5afef663..6588f3db4 100644 --- a/tests/ioctl_ptp.c +++ b/tests/ioctl_ptp.c @@ -269,7 +269,7 @@ test_no_device(void) ", nsec=%u%s}", XLAT_SEL(c->val, c->str), perout_flags[i].is_phase ? "phase" : "start", - perout->start.sec, + (long long) perout->start.sec, i & 1 ? 1234567890 : 123456789, i & 2 ? ", reserved=0xa205b064" : ""); if (!perout_flags[i].is_phase) { @@ -354,7 +354,7 @@ test_no_device(void) j++) { printf("%s{sec=%lld, nsec=%u%s}", j ? ", " : ", ts=[", - sysoff->ts[j].sec, + (long long) sysoff->ts[j].sec, sysoff->ts[j].nsec, j & 1 ? ", reserved=0xdeadface" : ""); @@ -488,7 +488,8 @@ test_no_device(void) XLAT_SEL(c->val, c->str)); if (rc >= 0) { printf("{device={sec=%lld, nsec=%u", - ts_vecs[i].sec, ts_vecs[i].nsec); + (long long) ts_vecs[i].sec, + ts_vecs[i].nsec); if (i & 1) { printf(", reserved=%#x", ts_vecs[i].reserved); @@ -496,7 +497,7 @@ test_no_device(void) printf("}"); print_lltime(ts_vecs[i].sec, ts_vecs[i].nsec); printf(", sys_realtime={sec=%lld, nsec=%u", - ARR_ITEM(ts_vecs, i + 1).sec, + (long long) ARR_ITEM(ts_vecs, i + 1).sec, ARR_ITEM(ts_vecs, i + 1).nsec); if (!(i & 1)) { printf(", reserved=%#x", @@ -507,7 +508,7 @@ test_no_device(void) print_lltime(ARR_ITEM(ts_vecs, i + 1).sec, ARR_ITEM(ts_vecs, i + 1).nsec); printf(", sys_monoraw={sec=%lld, nsec=%u", - ARR_ITEM(ts_vecs, i + 2).sec, + (long long) ARR_ITEM(ts_vecs, i + 2).sec, ARR_ITEM(ts_vecs, i + 2).nsec); if (i & 1) { printf(", reserved=%#x", @@ -580,7 +581,7 @@ test_no_device(void) for (size_t k = 0; k < 3; k++) { printf("%s{sec=%lld, nsec=%u", k ? ", " : "[", - soext->ts[j][k].sec, + (long long) soext->ts[j][k].sec, soext->ts[j][k].nsec); if (soext->ts[j][k].reserved) printf(", reserved=%#x", |