-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when using inttypes.h for PRImacros for esp_err_t (IDFGH-10042) #11319
Comments
I think |
@igrr In my opinion, it's hard to follow both specifiers. As espressif recommends that all the format specifiers should be changed to PRI-based specifiers to support different platforms and compilers. Is espressif planning to fix these issues in future versions? what about the size_t case? |
Sorry if the recommendation in the docs wasn't formulated clearly. We don't recommend replacing all the format specifiers with the PRI-based ones. inttypes.h specifiers should only be used for fixed-width integer types. See the "Format macro constants" section over at that page, various PRI* macros are used for different types defined in stdint.h, such as uint32_t, uintmax_t, intptr_t, and so on. For other types, refer to the documentation of printf family of functions. For example, for One note regarding |
So you are aware that this issue needs fix: #9631 |
@AxelLin yes, we are aware of that one and a few others. |
@aggaddam We clarified the migration guide a bit. It will be available on master soon. |
closing considering migration guide was udated |
Answers checklist.
IDF version.
release/v5.1
Operating System used.
Linux
How did you build your project?
Command line with idf.py
If you are using Windows, please specify command line type.
None
Development Kit.
ESP32C3-DEVKIT
Power Supply used.
USB
What is the expected behavior?
Unsilenced the warning for -Wno-format and replaced %d with %"PRId32" for esp_err_t and size_t. It should work with out typecast
What is the actual behavior?
Unsilenced the warning for -Wno-format and replaced %d with %"PRId32" for esp_err_t. But still, I am getting build errors with the below codes
Example 1: Getting error
Example 2: No error after typecast to int32_t
Example 3: Getting error
Example 4: No error after typecast to uint32_t
What data types are defined for esp_err_t and size_t in esp idf v5.1? Does the application need to typecast for these values to fix the build errors?
Steps to reproduce.
...
Debug Logs.
No response
More Information.
No response
The text was updated successfully, but these errors were encountered: