Repository navigation
Make 64-bit time_t unsigned - #8201
Conversation
|
@yamt |
just because i forgot to make it ready. |
* 32-bit time_t should be unsigned because otherwise it wraps too soon. (in 2038) * 64-bit time_t should be unsigned because it should be consistent within NuttX. * While signed time_t seems more popular among other OSes, the consisitency within NuttX outweighs, IMO.
|
the last push was a conflict resolution |
it has been changed by apache#10303 without any explicit mentions. i suppose it was a mistake. see apache#8201 and referenced PRs for previos discussions.
it has been changed by apache#10303 without any explicit mentions. i suppose it was a mistake. see apache#8201 and referenced PRs for previous discussions.
|
Posix time_t is signed as a consensus. Originally it triggered some controversy and debates over whether it should be signed or unsigned, the problem is not new. Why does this consensus exist? Because if unsigned you cannot represent times prior to the Unix epoch or between another arbitrary timer value, and Posix requires it to be an integral type that's it (the grey). Now, it has an impact on the sign comparison implementation, but it also has an impact on interpolating with other Unix-like sub-systems and/or third-party libraries (For instance, can be an issue in some network APIs if before expected hypothetical The truth is, there is a consensus and most people are adhering to it. Yes we know, the issue revolves around an informal practice. I think that the original change was not a random mistake, but rather an attempt to follow the consensus found in other popular projects. For the 2038 halt date, I don't think they will be 32-bit archs running anymore by then e.g 15 years ahead of us. |
it has been changed by apache#10303 without any explicit mentions. i suppose it was a mistake. see apache#8201 and referenced PRs for previous discussions.
it has been changed by apache#10303 without any explicit mentions. i suppose it was a mistake. see apache#8201 and referenced PRs for previous discussions.
it has been changed by apache#10303 without any explicit mentions. i suppose it was a mistake. see apache#8201 and referenced PRs for previous discussions.
Summary
32-bit time_t should be unsigned because otherwise it wraps too soon. (in 2038)
64-bit time_t should be unsigned because it should be consistent within NuttX.
While signed time_t seems more popular among other OSes, the consisitency within NuttX outweighs, IMO.
Previous attempts and discussions:
#7975
#7115
#4693
#4692
Impact
Testing