time: change time_t to signed type in TIME32/64
Summary
time: change time_t to signed type in TIME32/64
It is wrong to set the time_t to uint32_t, it should be signed type, see the reference here: https://www.gnu.org/software/libc/manual/html_node/Time-Types.html
Impact
time
Testing
sim
I think this is already 4th or 5th time the similar change is proposed in some variation. I think that such changes should be first discuss in the mailing list.
Just for reference https://github.com/apache/nuttx/pull/8201
Thank you for the reference @pkarashchenko I think @mu578 pointed it correctly about a consensus of using time_t as signed among other OSes and also the explanation about d-time usage for libraries. Also I think he is wrong about not have 32-bit arch around in 2038, it is just 14 years from now.
BTW, I think it is better to discuss about it in the mailing list as you suggested and later create some documentation/reference to avoid this issues come back.
Open group documents that definition of time_t is not specified but is mandated in order to eventually address the year 2038 problem.
The safe path for 2038 is enabling CONFIG_SYSTEM_TIME64. Actually, we enable CONFIG_SYSTEM_TIME64 in all products, since it's very fragile to support 2038 with 32bit time_t, not only for nuttx code base, but also for the 3rd library.
There can be pros and cons to either approach and therefore I think it should be discussed at mailing list.
Thanks for requesting the review. :-)
close dup with https://github.com/apache/nuttx/pull/14273