Skip to content
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

Change %p formatting to match glibc #90

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

elipsitz
Copy link

@elipsitz elipsitz commented Oct 1, 2020

The %p format is not defined by the standard, that is, it's implementation specific. However, many people are used to what glibc prints: 0x to emphasize that pointers are printed as hex, and a special "(nil)" string when a null pointer is provided, and lower-case letters for hex digits.

This fixes #57 and fixes #84.

This means prefixing with `0x` and using lowercase hex letters.
This means printing "(nil)" instead of "0".
@codecov-commenter
Copy link

Codecov Report

Merging #90 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #90   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines          359       362    +3     
=========================================
+ Hits           359       362    +3     
Impacted Files Coverage Δ
printf.c 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d3b9846...729dd39. Read the comment docs.

@eyalroz
Copy link

eyalroz commented Jun 28, 2021

Since this is non-standard, I suggest you have a preprocessor define controlling whether %p support is compiled-in or not. Also, what systems print %p the way the library does right now?

KarlK90 pushed a commit to qmk/printf that referenced this pull request Jul 7, 2022
…d and significant doxygen comment edits.
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.

%p prints uppercase alphabets %p format
3 participants