From 0492cc5177189c510a2e231f26f48062929459c4 Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Fri, 5 Feb 2021 16:20:08 +0100 Subject: [PATCH] pkg/wakaama: cast macro to time_t Currently on some toolchains the wakaama package is raising a floating point exception on native. This seems to be fixing the issue. --- .../0021-core-registration-cast-to-time.patch | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 pkg/wakaama/patches/0021-core-registration-cast-to-time.patch diff --git a/pkg/wakaama/patches/0021-core-registration-cast-to-time.patch b/pkg/wakaama/patches/0021-core-registration-cast-to-time.patch new file mode 100644 index 0000000000..21f69c7047 --- /dev/null +++ b/pkg/wakaama/patches/0021-core-registration-cast-to-time.patch @@ -0,0 +1,28 @@ +From 0ee68890355c4ebd15323511c46ff109ad106d49 Mon Sep 17 00:00:00 2001 +From: Leandro Lanzieri +Date: Fri, 5 Feb 2021 16:17:20 +0100 +Subject: [PATCH] core/registration: cast to time_t + +--- + core/registration.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/core/registration.c b/core/registration.c +index 03fa851..aed3607 100644 +--- a/core/registration.c ++++ b/core/registration.c +@@ -1313,9 +1313,9 @@ void registration_step(lwm2m_context_t * contextP, + time_t interval; + + nextUpdate = targetP->lifetime; +- if (COAP_MAX_TRANSMIT_WAIT < nextUpdate) ++ if ((time_t)COAP_MAX_TRANSMIT_WAIT < nextUpdate) + { +- nextUpdate -= COAP_MAX_TRANSMIT_WAIT; ++ nextUpdate -= (time_t)COAP_MAX_TRANSMIT_WAIT; + } + else + { +-- +2.30.0 +