Commit
33cb4d460e9b9ef320c6c281f1157883cdec4279
by Oliver Smithtests: fix for debian 13 armv7l
In Debian 13 armv7l, time_t and suseconds_t are "long long int" instead
of "long unsigned int" as seen on x86_64 and aarch64. This causes the
the tdef, time_cc and iuup tests to fail. Example:
-sys={0.000000}, clock_override_set
+sys={4206924.000000}, (null)
_tinit_timeout_retrans_transport_prim_cb()
Transport: DL len=22: e0 00 df 99 16 00 51 67 3c 01 27 00 00 82 00 00 00 17 10 00 01 00
-sys={1.000000}, clock_override_set
+sys={4206924.000001}, (null)
_tinit_timeout_retrans_transport_prim_cb()
Transport: DL len=22: e0 00 df 99 16 00 51 67 3c 01 27 00 00 82 00 00 00 17 10 00 01 00
-sys={2.000000}, clock_override_set
+sys={4206924.000002}, (null)
…
Furthermore it causes compiler warnings such as:
iuup/iuup_test.c: In function 'clock_override_set':
iuup/iuup_test.c:169:24: warning: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type '__time64_t' {aka 'long long int'} [-Wformat=]
169 | printf("sys={%lu.%06lu}, %s\n", osmo_gettimeofday_override_time.tv_sec,
| ~~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| long unsigned int __time64_t {aka long long int}
| %llu
iuup/iuup_test.c:169:30: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type '__suseconds64_t' {aka 'long long int'} [-Wformat=]
169 | printf("sys={%lu.%06lu}, %s\n", osmo_gettimeofday_override_time.tv_sec,
| ~~~~^
| |
| long unsigned int
| %06llu
170 | osmo_gettimeofday_override_time.tv_usec, __func__);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| __suseconds64_t {aka long long int}
CCLD iuup/iuup_test
Fix it by casting to "long unsigned int".
Related: OS#6828
Change-Id: I9580606d66bb0f891c0ef0179f99e2b901a8cf1c