Almost all printf conversions ending in '%' are undefined, but they're
traditionally treated as if the complete conversion specifier is "%%".
This patch modifies the parser to more closely match that behavior.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
libc/src/stdio/printf_core/parser.cpp | ||
---|---|---|
112 | Probably we should have a section in the main doc page about implementation-defined behaviors and rationale, with links to the implementations and tests. |
libc/src/stdio/printf_core/parser.cpp | ||
---|---|---|
112 | Address this before landing: Please use "we" instead of "I". Can be done as a follow up step: +1 for adding a doc page titled "Implementation Defined Behavior". |
libc/src/stdio/printf_core/parser.cpp | ||
---|---|---|
112 | I agree that we should have a page on implementation defined behavior and will do that in another patch. |
Fix a minor bug found in final testing.
Setting the variable from the result of a failed index parsing was setting
unexpected pieces of the FormatSection struct. This wouldn't have affected
any actual conversions, since the only conversion that regains its has_conv
flag is %% which ignores all options, but it was causing the test to fail.
Probably we should have a section in the main doc page about implementation-defined behaviors and rationale, with links to the implementations and tests.