xiaoxiang781216 commented on PR #7975: URL: https://github.com/apache/nuttx/pull/7975#issuecomment-1364906298
> > No, it's problem when CONFIG_SYSTEM_TIME64 is enabled and time_t is map to uint64_t. So, if you don't have a good reason, it's better to map time_t to int64_t like other OS. For !CONFIG_SYSTEM_TIME64 case, time_t is int32_t, but the other side is uint64_t, so it's safe to prompt int32_t(time_t) to uint64_t without warning. > > * the particular warning in libcxx seems ok to ignore. It exists in many places. I am afraid that not only libcxx but also many other libraries suffer the same issue. > * anyway, our tree does not seem -Wsign-compare clean regardless of this But it doesn't have any warning before we define time_t to uint64_t > * IMO consistency within nuttx is a good enough reason > > If so, why not change 32bit time_t to int32_t like other OS? > > because int32_t wraps too soon. int32_t can represent time correctly until 2038. The reliable fix is promoted time_t to int64_t like other OS. Typedef time_t to uint32_t mayn't work as your expectation (2106) since many software only test with signed int(https://en.wikipedia.org/wiki/Year_2038_problem). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org