Hi, Dear Maintainers
I met the following compile failure when I pass "-D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64" to build 32bit dpdk. The key command like:
gcc -m32 ... -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 ... -o lib/librte_ethdev.a.p/ethdev_ethdev_trace_points.c.o -c ../git/lib/ethdev/ethdev_trace_points.c.
../git/lib/ethdev/ethdev_trace.h: In function 'rte_eth_trace_timesync_write_time':
../git/lib/eal/include/rte_common.h:498:55: error: size of unnamed array is negative
498 | #define RTE_BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
[snip]
RTE_TRACE_POINT(
rte_eth_trace_timesync_write_time,
RTE_TRACE_POINT_ARGS(uint16_t port_id, const struct timespec *time,
int ret),
rte_trace_point_emit_u16(port_id);
rte_trace_point_emit_size_t(time->tv_sec);
rte_trace_point_emit_long(time->tv_nsec);
rte_trace_point_emit_int(ret);
)
[snip]
In order to support Y2038, "-D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64" is passed, the time->tv_sec is 64bit, but size_t is 32bits, so the error happend.
if I understand right, maybe it is possible that some codes will assign time->tv_sec to a size_t variable, so this check is meanningful. Maybe
what need to do
is make sure the whole project supports Y2038, avoid code similar like
assign time->tv_sec to a size_t variable, and then change rte_trace_point_emit_size_t(time->tv_sec);
to like rte_trace_point_emit_uint64_t(time->tv_sec);
Could you please help to check if my understanding is correct , and could you share if there is any plan to support Y2038? Great Thanks!
Regards
Changqing