Skip to content

Commit

Permalink
Fix compilation warning (#1740)
Browse files Browse the repository at this point in the history
Compiler warning : format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'uint32_t'
he compiler warning arises because the format specifier %lu expects a long unsigned int, but the variable free is of type uint32_t (which is typically unsigned int). The ESP32, part of the Espressif32 family, typically defines uint32_t as unsigned int, so using the %u format specifier is appropriate.
  • Loading branch information
PBrunot authored Feb 5, 2025
1 parent 8e4c612 commit b67b782
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion WiFiManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3402,7 +3402,7 @@ void WiFiManager::DEBUG_WM(wm_debuglevel_t level,Generic text,Genericb textb) {
uint32_t free = info.total_free_bytes;
uint16_t max = info.largest_free_block;
uint8_t frag = 100 - (max * 100) / free;
_debugPort.printf("[MEM] free: %5lu | max: %5u | frag: %3u%% \n", free, max, frag);
_debugPort.printf("[MEM] free: %5u | max: %5u | frag: %3u%% \n", free, max, frag);
#endif
}

Expand Down

0 comments on commit b67b782

Please sign in to comment.