You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/10/19 16:05:55 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #7115: time: Typedef time_t to uint64_t if CONFIG_SYSTEM_TIME64 is defined

xiaoxiang781216 commented on code in PR #7115:
URL: https://github.com/apache/incubator-nuttx/pull/7115#discussion_r999669764


##########
include/time.h:
##########
@@ -98,7 +98,11 @@
 
 /* Scalar types */
 
+#ifdef CONFIG_SYSTEM_TIME64
+typedef int64_t   time_t;         /* Holds time in seconds */

Review Comment:
   most system typedef time_t to signed type(32bit or 64bit):
   https://stackoverflow.com/questions/471248/what-is-time-t-ultimately-a-typedef-to
   NuttX is a special one which define time_t to unsigned 32bit. I guess the reason is that the unsigned type could double the the range of representation.
   But 64bit has enough bit to represent the very very long range human being can expect, so I follow other OS convention to typedef time_t to signed 64bit.



-- 
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-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org