tbnobody / OpenDTU

Software for ESP32 to talk to Hoymiles/TSUN/Solenso Inverters
GNU General Public License v2.0
1.69k stars 471 forks source link

Use long int format specifiers #2077

Closed hd1ex closed 1 week ago

hd1ex commented 1 week ago

Long integers should be prefixed with l in format strings.

My compiler won't let me compile without fixing this.

tbnobody commented 1 week ago

If I apply your PR I get the following warnings:

src/NetworkSettings.cpp: In member function 'void NetworkSettingsClass::loop()':
src/NetworkSettings.cpp:210:38: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'uint32_t' {aka 'unsigned int'} [-Wformat=]
                 MessageOutput.printf("Admin AP remaining seconds: %ld / %ld\r\n", _adminTimeoutCounter, _adminTimeoutCounterMax);
                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~~~~~~~~
src/NetworkSettings.cpp:210:38: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'uint32_t' {aka 'unsigned int'} [-Wformat=]

What toolchain version are you using?

hd1ex commented 1 week ago

Ok, seems like these types only change with the newer Arduino-ESP version. I will include these in my change for supporting arduino-esp-v3 and reorder them. Sorry for the noise!