* A compile failure related to "Y2038 Problem"
@ 2025-04-17 5:46 Li, Changqing
0 siblings, 0 replies; only message in thread
From: Li, Changqing @ 2025-04-17 5:46 UTC (permalink / raw)
To: dev; +Cc: Li, Changqing
[-- Attachment #1: Type: text/plain, Size: 1651 bytes --]
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
[-- Attachment #2: Type: text/html, Size: 11090 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-04-17 5:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-17 5:46 A compile failure related to "Y2038 Problem" Li, Changqing
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).