This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 892ecb4e40021ac887000ff98b3197dd524f8a23
Author: YAMAMOTO Takashi <yamam...@midokura.com>
AuthorDate: Fri Jan 20 18:42:31 2023 +0900

    Make 64-bit time_t unsigned
    
    * 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.
---
 include/time.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/time.h b/include/time.h
index 21beec9a78..3eac07e94a 100644
--- a/include/time.h
+++ b/include/time.h
@@ -109,7 +109,7 @@
 /* Scalar types */
 
 #ifdef CONFIG_SYSTEM_TIME64
-typedef int64_t   time_t;         /* Holds time in seconds */
+typedef uint64_t  time_t;         /* Holds time in seconds */
 #else
 typedef uint32_t  time_t;         /* Holds time in seconds */
 #endif

Reply via email to