Repository navigation
feat(libcurl): implement curl_m[v]fprintf and curl_m[v]printf - #18468
alvaroelpob wants to merge 11 commits into
Conversation
Port the two passes of curl 7.81.0 lib/mprintf.c with LP64 argument sizes and without the Windows I32/I64 qualifiers, reading arguments from the guest SysV va_list. Floating-point conversions go through the guest snprintf. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eams and stop on a failed write
Progress report (422923d → b10b6a8)📈 System libraries: 41.75% (+0.02%, +10 implemented functions) ✅ 10 implemented
Changed libraries (implemented exports)
|
|
Windows check of head Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release. The hosted Windows check does not run these tests on pull requests.
AI-assisted: yes. |
|
@alvaroelpob the formatting code is unchanged and still looks right to me. The merge of main brought back all 10 This branch also carries #17390's commits, so it will need a rebase once #17390 lands. It would be best to do the doc fix in the same round to avoid a second push. |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — no blocking findings
The change appears consistent with its stated goal at head b10b6a8d711f1e23d198a1444d67eea127736aee; I did not run checks, so a formal approval is not justified.
What I ran
No commands or tests were run. I read the prepared diff and all changed files through the pinned reader.
Results
| Check | Result | Note |
|---|---|---|
| Diff and changed files | passed | All reviewed files were included |
| Build and tests | not run | The description reports author-run results |
Findings
Blocking
None.
Non-blocking
None.
Not verified
Build, test suite, and convention checks were not run in this review. The author reports a full build and suite with 4583/4583 tests passing and check_conventions passing on e9568468a5, rather than the reviewed head. No files were excluded from review.
To get this to a good state
Nothing is required.
|
This pull request has conflicted with |
ligmaSec
left a comment
There was a problem hiding this comment.
Please reconcile the debt changes before merging. The merged debt document still lists all four stream formatting exports as unimplemented and restores unrelated pending entries, including curl_mime_data_cb beside its implemented MIME entry. A debt fragment scoped to the four stream exports would keep those other entries out of this PR.
I ran guest_curl_format and guest_curl_formatstreams with this stack applied on Linux. Both passed.
AI-assisted: yes.
|
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.
|
THEMANnt
left a comment
There was a problem hiding this comment.
The formatter changes don’t guarantee that floating-point normalization terminates for every supported value. Please limit the normalization to finite values and handle special values through the normal formatting path. The current fixtures exercise ordinary values; a regression test should confirm that special values return promptly with the expected formatting.
What
Implements
curl_mfprintf,curl_mvfprintf,curl_mprintfandcurl_mvprintf, which threw throughNotImplemented_nid_no_patch.Stacked on #17390, whose
CurlFormatformatter already follows both passes of curl 7.81.0lib/mprintf.c. This adds a stream output to it: in 7.81.0 the four functions calldprintf_formatfwithfputcand the caller'sFILE*orstdout(mprintf.c), andOUTCHARreturns the count so far on the firstfputcthat returns -1. Here each character goes through the guestfputcon the guest stream,_Stdoutforcurl_mprintfandcurl_mvprintf, and the formatter stops the same way. A format the formatter rejects returns -1 without output, as in #17390.The Formatting debt entry of #17390 now names these functions too, and their stub entries are removed. Only the last six commits belong to this pull request; the first two are #17390's.
Tested
Linux (WSL2, Ubuntu): full build and suite on e956846, 4583/4583 tests pass; check_conventions passes. The new guest_curl_formatstreams writes through curl_mfprintf and curl_mvfprintf to a guest file (positional and sequential arguments, %#x, a NULL %p, the 129-conversion -1 and a stream opened for reading, where the first failed fputc stops the output at 0), and through curl_mprintf and curl_mvprintf to the guest stdout reopened on a file.
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)