From 3508a888d8c1fcbff1777a9191100b09754a53c6 Mon Sep 17 00:00:00 2001 From: Oleg Kokorin Date: Thu, 7 Aug 2025 14:48:35 +0200 Subject: [PATCH 1/7] fix: warning: ISO C++ forbids converting a string constant to char* Signed-off-by: Oleg Kokorin --- .../cellular/include/cellular/framework/AT/AT_CellularDevice.h | 2 +- connectivity/cellular/source/framework/AT/AT_CellularDevice.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/connectivity/cellular/include/cellular/framework/AT/AT_CellularDevice.h b/connectivity/cellular/include/cellular/framework/AT/AT_CellularDevice.h index 07a5f90dad2..3d9d2c8eac6 100755 --- a/connectivity/cellular/include/cellular/framework/AT/AT_CellularDevice.h +++ b/connectivity/cellular/include/cellular/framework/AT/AT_CellularDevice.h @@ -67,7 +67,7 @@ class AT_CellularDevice : public CellularDevice { }; public: - AT_CellularDevice(FileHandle *fh, char *delim = "\r"); + AT_CellularDevice(FileHandle *fh, const char *delim = "\r"); virtual ~AT_CellularDevice(); virtual nsapi_error_t clear(); diff --git a/connectivity/cellular/source/framework/AT/AT_CellularDevice.cpp b/connectivity/cellular/source/framework/AT/AT_CellularDevice.cpp index e3fd5b551a3..4798576898a 100644 --- a/connectivity/cellular/source/framework/AT/AT_CellularDevice.cpp +++ b/connectivity/cellular/source/framework/AT/AT_CellularDevice.cpp @@ -39,7 +39,7 @@ using namespace std::chrono_literals; #define DEFAULT_AT_TIMEOUT 1s // at default timeout const int MAX_SIM_RESPONSE_LENGTH = 16; -AT_CellularDevice::AT_CellularDevice(FileHandle *fh, char *delim): +AT_CellularDevice::AT_CellularDevice(FileHandle *fh, const char *delim): CellularDevice(), _at(fh, _queue, DEFAULT_AT_TIMEOUT, delim), #if MBED_CONF_CELLULAR_USE_SMS From 5f375674fdd4a18b96454855d22dc86db1038082 Mon Sep 17 00:00:00 2001 From: Oleg Kokorin Date: Thu, 7 Aug 2025 14:55:21 +0200 Subject: [PATCH 2/7] fix: warning: 'port_start' may be used uninitialized in this function Signed-off-by: Oleg Kokorin --- .../GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.cpp b/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.cpp index a78e89a062b..75b2fae7d58 100644 --- a/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.cpp +++ b/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.cpp @@ -444,7 +444,7 @@ nsapi_size_or_error_t GEMALTO_CINTERION_CellularStack::socket_recvfrom_impl(Cell if (address) { char *ip_start = ip_address; char *ip_stop; - char *port_start; + char *port_start = (char *)0xDEADBEEF; if (_stack_type == IPV6_STACK) { ip_start++; // skip '[' ip_stop = strchr(ip_address, ']'); From 4c0e892d6c6556f16fc02eb6e5aa092f92c19331 Mon Sep 17 00:00:00 2001 From: Oleg Kokorin Date: Thu, 7 Aug 2025 15:02:08 +0200 Subject: [PATCH 3/7] fix: warning: 'status' may be used uninitialized in this function Signed-off-by: Oleg Kokorin --- .../stack/controller/sources/ble/lctr/lctr_main_iso.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connectivity/FEATURE_BLE/libraries/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_iso.c b/connectivity/FEATURE_BLE/libraries/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_iso.c index 369609871c6..bf81eb6df21 100644 --- a/connectivity/FEATURE_BLE/libraries/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_iso.c +++ b/connectivity/FEATURE_BLE/libraries/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_iso.c @@ -988,7 +988,7 @@ uint8_t LctrIsoReadTestCounter(uint16_t handle, LlIsoTestCtrs_t *pStats) /*************************************************************************************************/ uint8_t LctrIsoTestEnd(uint16_t handle, LlIsoTestCtrs_t *pStats) { - uint8_t status; + uint8_t status = LL_ERROR_CODE_UNSPECIFIED_ERROR; lctrCisCtx_t *pCisCtx; lctrBisCtx_t *pBisCtx; From c2c3c640b2d3a0f1ff8758a58527e4836c97156f Mon Sep 17 00:00:00 2001 From: Oleg Kokorin Date: Thu, 7 Aug 2025 15:09:50 +0200 Subject: [PATCH 4/7] fix: warning: 'active_direct_confirm' may be used uninitialized in this function Signed-off-by: Oleg Kokorin --- .../sal-stack-nanostack/source/6LoWPAN/adaptation_interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connectivity/nanostack/sal-stack-nanostack/source/6LoWPAN/adaptation_interface.c b/connectivity/nanostack/sal-stack-nanostack/source/6LoWPAN/adaptation_interface.c index 55904778f07..fb7027bf1a3 100644 --- a/connectivity/nanostack/sal-stack-nanostack/source/6LoWPAN/adaptation_interface.c +++ b/connectivity/nanostack/sal-stack-nanostack/source/6LoWPAN/adaptation_interface.c @@ -1554,7 +1554,7 @@ int8_t lowpan_adaptation_interface_tx_confirm(protocol_interface_info_entry_t *c //Check first fragmenter_tx_entry_t *tx_ptr; - bool active_direct_confirm; + bool active_direct_confirm = false; if (lowpan_active_tx_handle_verify(confirm->msduHandle, interface_ptr->active_broadcast_tx_buf.buf)) { active_direct_confirm = true; tx_ptr = &interface_ptr->active_broadcast_tx_buf; From 1fe7cb7032cee725cc2d13f6bbef0d866eaba3f6 Mon Sep 17 00:00:00 2001 From: Oleg Kokorin Date: Thu, 7 Aug 2025 15:19:18 +0200 Subject: [PATCH 5/7] fix: warning: unused variable 'led_err' Signed-off-by: Oleg Kokorin --- platform/source/mbed_board.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/source/mbed_board.c b/platform/source/mbed_board.c index 47c92e06145..0f9553fdb14 100644 --- a/platform/source/mbed_board.c +++ b/platform/source/mbed_board.c @@ -28,8 +28,8 @@ WEAK MBED_NORETURN void mbed_die(void) #if !defined(TARGET_EFM32) core_util_critical_section_enter(); #endif - gpio_t led_err; #ifdef LED1 + gpio_t led_err; gpio_init_out(&led_err, LED1); #endif From 746fd4f6abd42bfc34ae9b29ea8d2b03c30123e8 Mon Sep 17 00:00:00 2001 From: Oleg Kokorin Date: Thu, 7 Aug 2025 15:23:13 +0200 Subject: [PATCH 6/7] fix: warning: unused variable 'ret' Signed-off-by: Oleg Kokorin --- storage/kvstore/tdbstore/source/TDBStore.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/kvstore/tdbstore/source/TDBStore.cpp b/storage/kvstore/tdbstore/source/TDBStore.cpp index 50f490cf370..2003483af69 100644 --- a/storage/kvstore/tdbstore/source/TDBStore.cpp +++ b/storage/kvstore/tdbstore/source/TDBStore.cpp @@ -1490,7 +1490,7 @@ int TDBStore::check_erase_before_write(uint8_t area, uint32_t offset, uint32_t s uint32_t end_offset; while (size) { uint32_t dist, offset_from_start; - int ret; + // int ret; offset_in_erase_unit(area, offset, offset_from_start, dist); uint32_t chunk = std::min(size, dist); From 5ca33de31e03a309481dd73a589d650bc9f45e10 Mon Sep 17 00:00:00 2001 From: Oleg Kokorin Date: Thu, 7 Aug 2025 15:28:29 +0200 Subject: [PATCH 7/7] fix: warning: unused variable 'pin' Signed-off-by: Oleg Kokorin --- targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/spi_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/spi_api.c b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/spi_api.c index 3cd900edca1..ec4a68886ab 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/spi_api.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/spi_api.c @@ -212,7 +212,7 @@ void spi_get_capabilities(PinName ssel, bool slave, spi_capabilities_t *cap) // check if given ssel pin is in the cs pinmap const PinMap *cs_pins = spi_master_cs_pinmap(); - PinName pin = NC; + // PinName pin = NC; while (cs_pins->pin != NC) { if (cs_pins->pin == ssel) { #if DEVICE_SPISLAVE