Repository navigation
Conversation
MarcZX10
left a comment
There was a problem hiding this comment.
The PR currently contains two commits: feat(libc): implement strsep and memccpy (the exact head commit of open PR #1976) plus the ffs/labs commit. Since this PR targets main, its diff duplicates #1976, while the checklist says Depends on: none. Could you either rebase this branch onto main with only the ffs/labs commit, or make the dependency/stack explicit and update the base/description to match the project workflow? This will keep the contribution one-topic and avoid overlapping changes being merged twice.
|
Thanks for catching that. I rebased the branch onto current |
018efcf to
3cd9569
Compare
MarcZX10
left a comment
There was a problem hiding this comment.
One cross-platform ABI issue remains: this project targets an LP64 guest, but native long is 32 bits on Windows. Math.cpp already documents this for guest lround and uses std::int64_t; these new labs/ffsl signatures and unsigned long arithmetic instead use the host width. On Windows, ffsl cannot see bits 32–63, labs has the wrong return width, and 0x100000000L in the test is not a 64-bit value. Please use the project’s 64-bit guest-long type (std::int64_t, with std::uint64_t for bit operations) for labs/ffsl and make those test values explicitly 64-bit. This needs a Windows build/test before the PR is ready.
|
Good catch, thanks. Linux: the full suite (494 tests) passes and |
MarcZX10
left a comment
There was a problem hiding this comment.
I verified commit 44f2875: the duplicate #1976 commit is gone, and labs/ffsl plus their tests now use 64-bit guest-long types. That resolves both review points. GitHub currently reports no checks for this head, though the description says Windows CI will validate the ABI fix. Please request/trigger the checks; I can finish the review once they report on this exact head.
MarcZX10
left a comment
There was a problem hiding this comment.
The new head’s runs are now visible as action_required for Build, Conventions, and Progress report (all on 44f2875). That is the repository’s workflow-approval gate, not a source failure. A maintainer must approve the runs; once they complete, I can verify Windows CI and finalize the review.
|
Same as #1976: please reopen with the title and the log line if one reaches these on main. |
|
First Windows run, since the description says it wasn't tested on Windows. Setup: Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Merged onto
🤖 Addressed by Claude Code |
What
ffs,ffsl,ffsll,labsandimaxabswere not exported.ffs*return the 1-based index of the least significant set bit, 0 for 0.labsandimaxabsnegate in unsigned arithmetic, so the minimum value maps to itself instead of overflowing.core/libs/prx/libc/src/Math.cpp: the five functions.guest_mathtest: zero, negative values, bits above 32 and the minimum values.Tested
Linux (CachyOS), GCC 16.2.1, Release.
tools/check_conventions.py --base upstream/mainpasses.Not tested on Windows or macOS.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)