Skip to content

Fix incorrect printf format specifier#337

Merged
pikasTech merged 1 commit intopikasTech:masterfrom
IVOES:cpp/wrong-type-format-argument
Aug 15, 2024
Merged

Fix incorrect printf format specifier#337
pikasTech merged 1 commit intopikasTech:masterfrom
IVOES:cpp/wrong-type-format-argument

Conversation

@szsam
Copy link
Copy Markdown
Contributor

@szsam szsam commented Mar 27, 2024

PRI macros should be used for uintptr_t. Calling a printf-like function with the wrong type of arguments causes unpredictable behavior.

PRI macros should be used for uintptr_t. Calling a printf-like function
with the wrong type of arguments causes unpredictable behavior.
@pikasTech
Copy link
Copy Markdown
Owner

I am not sure if <inttypes.h> can be used on various embedded platforms, such as stm32 and other MCU SDKs. This requires some testing, and I will validate these platforms when I have time, so this pull request will be delayed. It would be even better if you could help with testing.

@pikasTech
Copy link
Copy Markdown
Owner

As <inttypes.h> was added to C99 and tested on mdk-arm and AIR, this PR would be merged.

@pikasTech pikasTech merged commit 288465e into pikasTech:master Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants