From 55f6518853122d3edb275f37656a980d45bf5544 Mon Sep 17 00:00:00 2001 From: Janne Kiiskila Date: Mon, 30 Sep 2019 14:43:34 +0300 Subject: [PATCH] AT_CellularDevice.cpp - unused variable err warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We get this compiler warning; Compile [ 7.9%]: AT_CellularDevice.cpp [Warning] AT_CellularDevice.cpp@206,18: variable 'err' set but not used [-Wunused-but-set-variable] Due to the fact, that the code that would actually use this variable is behind trace flags. Based on review feedback from Antti Kauppila and Kimmo Väisänen, adding same flagging also for that. - Reason being - the operation needs to be within the locks. --- features/cellular/framework/AT/AT_CellularDevice.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/features/cellular/framework/AT/AT_CellularDevice.cpp b/features/cellular/framework/AT/AT_CellularDevice.cpp index bbfb92e06d..35cbab43fc 100644 --- a/features/cellular/framework/AT/AT_CellularDevice.cpp +++ b/features/cellular/framework/AT/AT_CellularDevice.cpp @@ -203,7 +203,9 @@ nsapi_error_t AT_CellularDevice::get_sim_state(SimState &state) _at->flush(); nsapi_error_t error = _at->at_cmd_str("+CPIN", "?", simstr, sizeof(simstr)); ssize_t len = strlen(simstr); +#if MBED_CONF_MBED_TRACE_ENABLE device_err_t err = _at->get_last_device_error(); +#endif _at->unlock(); if (len != -1) {