WiFiManager icon indicating copy to clipboard operation
WiFiManager copied to clipboard

Compiler warning, Debug_WM, %5lu should be %5u

Open Dario503 opened this issue 10 months ago • 2 comments

.pio/libdeps/esp32-s3-wroom-N8R8/WiFiManager/WiFiManager.cpp:150:100:   required from here
.pio/libdeps/esp32-s3-wroom-N8R8/WiFiManager/WiFiManager.cpp:3405:23: error: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'uint32_t' {aka 'unsigned int'} [-Werror=format=]
     _debugPort.printf("[MEM] free: %5lu | max: %5u | frag: %3u%% \n", free, max, frag);

Changing %5lu to %5u eliminates all -Wall warnings.

_debugPort.printf("[MEM] free: %5u | max: %5u | frag: %3u%% \n", free, max, frag);

//_debugPort.printf("[MEM] free: %5lu | max: %5u | frag: %3u%% \n", free, max, frag);

Dario503 avatar Feb 04 '25 18:02 Dario503

Which version of the ESP-IDF is that on? The %5u version used to build okay for me for ESP32S3 on ESP-IDF v4.4.6, but after switching to v5.3.3 I need the %5lu version for it to build.

Maybe the suggestion in this comment would fix it for both possibilities?

amcewen avatar May 21 '25 15:05 amcewen

Lol maintainer is dead..... still same issue (anyone if needed just replace the line or remove)

_debugPort.printf("[MEM] free: %5lu | max: %5lu | frag: %3lu%% \n", static_cast(free), static_cast(max), static_cast(frag));

Nirab123456 avatar Nov 16 '25 22:11 Nirab123456