diff options
author | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2021-04-19 09:30:18 +0200 |
---|---|---|
committer | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2021-04-20 07:07:52 +0200 |
commit | 259dee218e9ec9f32ae86771f7dd61466aa8bd74 (patch) | |
tree | 68b25a5cb5a67e442a4ca7c101da977657cff124 /src/corelib/time/qdatetime.cpp | |
parent | 366bdcde97962cf5804c519e9b605eddb543a592 (diff) |
Fix another compilation error in QDateTime
Similar fix as 538e9fa5689a1afe0d821b84cdfeaa1656973083 : gcc 7.5,
used e.g. on Jetson, is not able to resolve the add_overflow overload
without help.
Change-Id: I4d497480bb8dc82d7b1cbd13fda8e291935c8752
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/time/qdatetime.cpp')
-rw-r--r-- | src/corelib/time/qdatetime.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/corelib/time/qdatetime.cpp b/src/corelib/time/qdatetime.cpp index 28816ccef6..d61bd3a69b 100644 --- a/src/corelib/time/qdatetime.cpp +++ b/src/corelib/time/qdatetime.cpp @@ -2663,7 +2663,9 @@ bool QDateTimePrivate::epochMSecsToLocalTime(qint64 msecs, QDate *localDate, QTi : QDateTimePrivate::StandardTime; } - if (add_overflow(msecs, sys.d->offsetFromUtc(msecs) * MSECS_PER_SEC, &msecs)) + // NB: cast to qint64 here is important to make sure a matching + // add_overflow is found, GCC 7.5.0 fails without this cast + if (add_overflow(msecs, qint64(sys.d->offsetFromUtc(msecs) * MSECS_PER_SEC), &msecs)) return false; msecsToTime(msecs, localDate, localTime); return true; |