-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Closed
Labels
Status: SolvedThe issue has been resolved and requires no further action.The issue has been resolved and requires no further action.
Description
Platformio:
PLATFORM: Espressif 32 (2024.4.12+sha.9d4b8e6) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
platform = espressif32
platform_packages=
platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.0-rc1
platformio/framework-arduinoespressif32-libs @ https://github.com/espressif/esp32-arduino-libs.git#idf-release/v5.1
board = esp32dev
Switching to Arduino 3 leads to several printf warnings regarding type definition changed from int to long.
Example:
/Users/mat/Data/Workspace/me/WebSerialLite/examples/demo_ap/demo_ap.ino: In function 'void loop()':
/Users/mat/Data/Workspace/me/WebSerialLite/examples/demo_ap/demo_ap.ino:53:22: warning: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'uint32_t' {aka 'long unsigned int'} [-Wformat=]
53 | WebSerial.printf("Free heap=[%u]\n", ESP.getFreeHeap());
| ^~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~
| |
| uint32_t {aka long unsigned int}
The problem is that printf format is setup by the developer according to the expected type of the argument. If those type change, the format might become incorrect.
In the example above, fixing the format for Arduino 3 would make it wrong for Arduino 2...
What would be the solution for library developer to maintain a compatibility with Arduino 2 & 3 in such case ?
I saw some old issues referencing this same problem but they seemed to be closed or left:
- Esp32c3
int32_t
should beint
and notlong int
#5086 - Esp32c3
int32_t
should beint
and notlong int
(IDFGH-5124) esp-idf#6906
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
- I confirm I have checked existing issues, online documentation and Troubleshooting guide.
Metadata
Metadata
Assignees
Labels
Status: SolvedThe issue has been resolved and requires no further action.The issue has been resolved and requires no further action.