diff --git a/platform/mbed_mktime.c b/platform/mbed_mktime.c index 49b4a4a610..6954e723f4 100644 --- a/platform/mbed_mktime.c +++ b/platform/mbed_mktime.c @@ -105,7 +105,7 @@ time_t _rtc_mktime(const struct tm* time) { } if (result > INT32_MAX) { - return -1; + return (time_t) -1; } return result; diff --git a/platform/mbed_rtc_time.cpp b/platform/mbed_rtc_time.cpp index 6f26fb27a8..7a0ef48834 100644 --- a/platform/mbed_rtc_time.cpp +++ b/platform/mbed_rtc_time.cpp @@ -53,7 +53,7 @@ time_t time(time_t *timer) } } - time_t t = -1; + time_t t = (time_t)-1; if (_rtc_read != NULL) { t = _rtc_read(); }