From 7e73a36ed39230ee140b79bc9b093436a43745b7 Mon Sep 17 00:00:00 2001 From: pennam Date: Thu, 7 Jul 2022 13:27:30 +0200 Subject: [PATCH 1/4] Fix variable initialization order The change will fix a build error raised with the last esp32 core 2.0.4 --- src/ArduinoIoTCloud.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ArduinoIoTCloud.cpp b/src/ArduinoIoTCloud.cpp index 0b2794ade..0d9102d67 100644 --- a/src/ArduinoIoTCloud.cpp +++ b/src/ArduinoIoTCloud.cpp @@ -32,8 +32,8 @@ ArduinoIoTCloudClass::ArduinoIoTCloudClass() , _tz_offset{0} , _tz_dst_until{0} , _thing_id{""} -, _device_id{""} , _lib_version{AIOT_CONFIG_LIB_VERSION} +, _device_id{""} , _cloud_event_callback{nullptr} , _thing_id_outdated{false} { From ac87510024a5cf8b049f2ada090fbfe61e410faf Mon Sep 17 00:00:00 2001 From: pennam Date: Thu, 7 Jul 2022 16:31:26 +0200 Subject: [PATCH 2/4] Ignore unused-variable warning for internal_posix_time variable Otherwise in combination with -Werror=all used in newer ESP32 cores will trigger a compilation error. --- src/ArduinoIoTCloudTCP.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ArduinoIoTCloudTCP.cpp b/src/ArduinoIoTCloudTCP.cpp index 4d08e4a36..5aab44f95 100644 --- a/src/ArduinoIoTCloudTCP.cpp +++ b/src/ArduinoIoTCloudTCP.cpp @@ -387,7 +387,10 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_ConnectPhy() ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_SyncTime() { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" unsigned long const internal_posix_time = _time_service.getTime(); +#pragma GCC diagnostic pop DEBUG_VERBOSE("ArduinoIoTCloudTCP::%s internal clock configured to posix timestamp %d", __FUNCTION__, internal_posix_time); return State::ConnectMqttBroker; } From 5b03e5062b10f414896a3d66d26c86c6971a7f04 Mon Sep 17 00:00:00 2001 From: pennam Date: Thu, 7 Jul 2022 16:34:32 +0200 Subject: [PATCH 3/4] Declare is_watchdog_enabled only for platform supporting watchdog --- src/utility/watchdog/Watchdog.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utility/watchdog/Watchdog.cpp b/src/utility/watchdog/Watchdog.cpp index 8e91b1ecd..7fdbbd347 100644 --- a/src/utility/watchdog/Watchdog.cpp +++ b/src/utility/watchdog/Watchdog.cpp @@ -41,8 +41,9 @@ /****************************************************************************** * GLOBAL VARIABLES ******************************************************************************/ - +#if defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_MBED) static bool is_watchdog_enabled = false; +#endif /****************************************************************************** * FUNCTION DEFINITION From c0ac252e3920b1f823be62998377dfb570509814 Mon Sep 17 00:00:00 2001 From: pennam Date: Thu, 7 Jul 2022 16:35:28 +0200 Subject: [PATCH 4/4] Ignore unused funtion warning Otherwise in combination with -Werror=all used in newer ESP32 cores will trigger a compilation er ror. --- src/cbor/lib/tinycbor/src/open_memstream.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cbor/lib/tinycbor/src/open_memstream.c b/src/cbor/lib/tinycbor/src/open_memstream.c index 707dbb1c4..4d79a726e 100644 --- a/src/cbor/lib/tinycbor/src/open_memstream.c +++ b/src/cbor/lib/tinycbor/src/open_memstream.c @@ -46,6 +46,7 @@ typedef size_t LenType; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpedantic" #pragma GCC diagnostic ignored "-Wreturn-type" +#pragma GCC diagnostic ignored "-Wunused-function" struct Buffer {