-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[libc] Add printf error handling #162876
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
Merged
michaelrj-google
merged 27 commits into
llvm:main
from
mleleszi:libc-printf-error-handling
Nov 3, 2025
Merged
[libc] Add printf error handling #162876
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
25c7d79
Change writer to store chars written as size_t
mleleszi 362c00e
Prinf internals: use -errno as return values rather than custrom erro…
mleleszi f8c7569
Refactor printf family functions to use PrintfResult
mleleszi f8f3553
Formatting
mleleszi 4761e9a
Fix tests
mleleszi 1dd65af
Add IO error test cases for file variants
mleleszi ef55545
Add overflow test for fprintf
mleleszi 63c710b
Cleanup
mleleszi e035a15
Add overflow test for vfprintf
mleleszi 56d6968
Baremetal stuff
mleleszi 995bb08
Add test for nullptr write error
mleleszi eedbad9
Add overflow handling to strfrom functions
mleleszi 242b75c
Cleanup
mleleszi a403604
Merge branch 'main' into libc-printf-error-handling
mleleszi 492b9f1
Run clang-format
mleleszi 71554f9
Fix unused param error
mleleszi b03c545
Refactor File to store error_code instead of error flag
mleleszi 6d05774
Map internall err code to errno
mleleszi d194975
Return system IO errors return values
mleleszi 69e9362
Use ErroOr for print retval instead of custom struct
mleleszi f8cb702
Fix tests
mleleszi 0e8b25c
Fix baremetal impl
mleleszi 756cb37
Clean up tests, dependencies
mleleszi 463e929
Add platfrom specific error converter implementations
mleleszi 5f3b0af
Clean up dependencies
mleleszi 428c7e9
Add darwin and generic impl of error converter
mleleszi 21df095
Cleanup
mleleszi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.