include/osl/time.h                 |    5 ++++-
 sal/osl/unx/time.cxx               |    2 ++
 ucb/source/ucp/gio/gio_content.cxx |    2 ++
 3 files changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 2c8ced01216096dd03a4143fe41b4c5653deb67a
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Tue Sep 13 13:11:12 2022 +0200
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Tue Sep 13 17:14:26 2022 +0200

    cid#1509290, cid#1509240: Silence "Use of 32-bit time_t (Y2K38_SAFETY)" for 
now
    
    We'll eventually need to do something about the 32 bit TimeValue::Seconds, 
but
    as it is unsigned we should be fine for another 80 years (until "06:28:15 
UTC on
    Sunday, 7 February 2106", according to
    <https://en.wikipedia.org/wiki/Year_2038_problem#Solutions>).
    
    Change-Id: I74e680be0b2f0ef8cd84d6bc0faef436efc8d3cd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139859
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

diff --git a/include/osl/time.h b/include/osl/time.h
index 5c5096cada8a..a906a15bfe8a 100644
--- a/include/osl/time.h
+++ b/include/osl/time.h
@@ -39,7 +39,10 @@
 #   pragma pack(push, 8)
 #endif
 
-/* Time since Jan-01-1970 */
+/* Time since Jan-01-1970
+
+   TODO: sal_uInt32 TimeValue::Seconds is only large enough for representing 
dates until year 2106.
+*/
 
 #if defined LIBO_INTERNAL_ONLY && defined __cplusplus
 
diff --git a/sal/osl/unx/time.cxx b/sal/osl/unx/time.cxx
index a77015614e74..d6a2ca33ba6c 100644
--- a/sal/osl/unx/time.cxx
+++ b/sal/osl/unx/time.cxx
@@ -170,6 +170,8 @@ sal_Bool SAL_CALL osl_getTimeValueFromDateTime( const 
oslDateTime* pDateTime, Ti
         bias = aTime.tm_isdst > 0 ? timezone - 3600 : timezone;
 #endif
 
+        // coverity[store_truncates_time_t] - TODO: sal_uInt32 
TimeValue::Seconds is only large
+        // enough for integer time_t values < 2^32 representing dates until 
year 2106:
         pTimeVal->Seconds = nSeconds;
         pTimeVal->Nanosec = pDateTime->NanoSeconds;
 
diff --git a/ucb/source/ucp/gio/gio_content.cxx 
b/ucb/source/ucp/gio/gio_content.cxx
index fc31965a990f..5c225a951dbd 100644
--- a/ucb/source/ucp/gio/gio_content.cxx
+++ b/ucb/source/ucp/gio/gio_content.cxx
@@ -422,6 +422,8 @@ static css::util::DateTime getDateFromUnix (time_t t)
 {
     TimeValue tv;
     tv.Nanosec = 0;
+    // coverity[store_truncates_time_t] - TODO: sal_uInt32 TimeValue::Seconds 
is only large enough
+    // for integer time_t values < 2^32 representing dates until year 2106:
     tv.Seconds = t;
     oslDateTime dt;
 

Reply via email to