Skip to content

Commit

Permalink
Fix warning with logging off in GNSS and Wifi: unused variables. (#759)
Browse files Browse the repository at this point in the history
In two places, one in GNSS and one in Wi-Fi, a variable was used only in the logging code and hence when logging is compiled out a warning was emitted. With this commit the "build with logging off" tests is updated to include a check for unused variables and the two occurrences are fixed.
  • Loading branch information
RobMeades committed Jan 5, 2023
1 parent 9e738a7 commit 4889b44
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion common/network/src/u_network_private_wifi.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ static void wifiConnectionCallback(uDeviceHandle_t devHandle,
}
}

#if defined(U_CFG_ENABLE_LOGGING) && !U_CFG_OS_CLIB_LEAKS
#if U_CFG_ENABLE_LOGGING && !U_CFG_OS_CLIB_LEAKS
if (status == U_WIFI_CON_STATUS_CONNECTED) {
uPortLog(LOG_TAG "Wifi connected connId: %d, bssid: %s, channel: %d\n",
connId,
Expand Down
2 changes: 2 additions & 0 deletions gnss/src/u_gnss.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
* STATIC VARIABLES
* -------------------------------------------------------------- */

#if U_CFG_ENABLE_LOGGING
/** To display some nice text.
*/
//lint -esym(752, gpTransportTypeText) Suppress not referenced, which
Expand All @@ -75,6 +76,7 @@ static const char *const gpTransportTypeText[] = {"None", // U_GNSS_TRANSP
"UBX UART", // U_GNSS_TRANSPORT_UBX_UART
"UBX I2C" // U_GNSS_TRANSPORT_UBX_I2C
};
#endif

/* ----------------------------------------------------------------
* STATIC FUNCTIONS
Expand Down
2 changes: 1 addition & 1 deletion port/platform/static_size/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ endif
SILENT = @

# Compiler flags
override CFLAGS += -Os -g0
override CFLAGS += -Os -g0 -Wall -Werror
LDFLAGS += -Wl,--cref --specs=nano.specs -lc -lnosys

# Compiler flags for no float
Expand Down

0 comments on commit 4889b44

Please sign in to comment.