Repository navigation
fix(libc): match reported wide scanf edge cases - #9331
Conversation
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
Windows run, the platform the description doesn't list, plus a wider set of inputs compared with main and with FreeBSD 11.4. Head
So the change is not limited to Literals, main → PR:
For a literal that meets end of input, FreeBSD 11.4's AI-assisted: yes (Claude Code); results above were run on this machine. |
|
Linux data point for
AI-assisted (Claude Code). |
harisibrar1
left a comment
There was a problem hiding this comment.
Checked against main 8b3e398 and FreeBSD 11.4 lib/libc/stdio/vfwscanf.c (release/11.4.0), plus the "Remaining differences" in #8479:
- The debt line seems to read main's "FreeBSD's
vfwscanfreports an input failure for the first and converts the second" as being about0x. On main, "the first" is the literal mismatch: vfwscanf.c L493-495 goes toinput_failurewhen the character differs. - For
0xwith%x, FreeBSD'sparseintpushes back thexand converts the0(L405-418, withPFXOKfrom L565). So0x/%xreturns 1 with 0 there, not an input failure. - As written, the entry now says the wrong thing about
0x, and it no longer records thata/b%dreturns 0 here butEOFon FreeBSD. Could the literal-mismatch divergence be kept, and the0xclause say that FreeBSD converts it as 0? - Small one: the literal-at-end-of-input sentence could also say it follows #8479 and that FreeBSD returns
EOFthere, as the exponent sentence does. - #8306, #9087 and #6044 are all still open, and this PR merges and passes on main without them. If they are only shared-file overlaps, moving them out of "Depends on" might keep this from being held up.
Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.
|
The new measurements in #9321 resolve the Could the |
Co-Authored-By: Claude <noreply@anthropic.com>
c092916 to
e8c7362
Compare
|
Checked the incomplete-exponent and literal-at-EOF changes against the measurements in #9321 (bundled Added on top:
merged. |
What
Implements two of the reported wide-scanner differences in #9321, based on the console scanner behavior reported in merged #8479: an incomplete floating-point exponent such as
1e+converts its mantissa, and a format literal at end-of-input returns the assignment count (zero when nothing was assigned) instead ofEOF. Adds regressions for sized and unsized buffer scans and the stream scanner.The reported short
%cfield behavior is not included: #9321 asks to confirm its return count, partial-output extent and precedence first. The libc debt entry records that remaining gap. This pull request does not close #9321.Tested
Linux x86-64, Debian GCC 12.2, Release. Configured with
cmake -S . -B build -G Ninja -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release -DANYPS5_USE_SYSTEM_DEPS=OFF; builtguest_wide_conversion_testsandguest_wide_stream_scan_tests; CTest passedguest_wide_conversionandguest_wide_stream_scan(2/2). No PS5 runtime or hardware test was performed.python3 tools/check_conventions.py --base upstream/mainreports zero errors and one debt-length warning on the existing libc scanner entry. The required localorigin/mainreference is 10,325 commits behind upstream; checking against it reports unrelated historical findings outside this change.tools/pr_overlap.pyreports dependencies listed below.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)