Skip to content

Commit 55f6518

Browse files
author
Janne Kiiskila
committed
AT_CellularDevice.cpp - unused variable err warning
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.
1 parent 1319843 commit 55f6518

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

features/cellular/framework/AT/AT_CellularDevice.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,9 @@ nsapi_error_t AT_CellularDevice::get_sim_state(SimState &state)
203203
_at->flush();
204204
nsapi_error_t error = _at->at_cmd_str("+CPIN", "?", simstr, sizeof(simstr));
205205
ssize_t len = strlen(simstr);
206+
#if MBED_CONF_MBED_TRACE_ENABLE
206207
device_err_t err = _at->get_last_device_error();
208+
#endif
207209
_at->unlock();
208210

209211
if (len != -1) {

0 commit comments

Comments
 (0)