printf: preserve failure status after character constant warning - #15033
Open
SichenLiang wants to merge 1 commit into
Open
SichenLiang wants to merge 1 commit into
SichenLiang wants to merge 1 commit into
Conversation
Set failure status for numeric parse errors, while leaving the current status untouched when a quoted character constant has ignored trailing characters. A warning alone still exits successfully; a prior numeric error remains a failure. POSIXLY_CORRECT suppresses the warning without clearing that earlier failure.
Merging this PR will improve performance by 14.28%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ⚡ | Simulation | three_39_bit_primes |
684.4 ms | 536.1 ms | +27.66% |
| ⚡ | Simulation | five_38_bit_primes |
1.7 s | 1.6 s | +11.03% |
| ⚡ | Simulation | thirteen_39_bit_primes |
9.3 s | 8.8 s | +5.31% |
Tip
Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.
Comparing SichenLiang:printf-char-constant-status (019d35d) with main (5b2e6e0)
Footnotes
-
54 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
An invalid numeric argument sets the exit status to 1. A later quoted character constant with ignored trailing characters was resetting it to 0, so this command succeeded where GNU coreutils 9.12 fails:
Set the failure status only in the three numeric-error branches. The character-constant warning now leaves the current status unchanged. A warning by itself still exits 0, and
POSIXLY_CORRECTstill suppresses the warning without clearing an earlier failure.The new test covers both the normal and
POSIXLY_CORRECTcases.Closes #15032