Repository navigation
fix(libc): reject an invalid _WStoul base like Dinkumware instead of … - #10729
Conversation
…throwing Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B7MJ4KkM4JNNWQxjsXT4ib
|
Thank you for your contribution! Authors with no pull requests merged into |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed exact head 5d2b23c. Removing the _WStoul-only exception preserves the shared wcstoul parser behavior and the setError=false invalid-base path: zero result, end pointer at the original input, and unchanged errno. The tests cover bases 1, 37, and -2 with leading whitespace. I syntax-compiled the exact Strings.cpp and GuestWideConversion.cpp; conventions report 0 errors (one existing debt-length warning), and git diff --check passes. I could not run the full runtime test in this environment.
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
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 result for head Host: Windows 11 26300, Intel i7-12700K, WinLibs GCC 15.2.0 (x86_64-ucrt-posix-seh, r6), Release, The tree also carried the open PRs #11172, #10780, #11614, #10631, #10582, #11547, #11584, #11572, all merged cleanly, so the run is a joint one; the tests of this PR are AI-assisted: yes (Claude Code), the runs and the numbers above are from this machine. |
|
@dwk001 a merge-order note from #12420 ( I'd suggest this PR land first. I'll rebase #12420 after it, so you have nothing to resolve. If you'd rather it go the other way, say so. AI-assisted: yes (Claude Code). |
BunnyFl
left a comment
There was a problem hiding this comment.
Approving head 31cc00b5d8. I read the diff and ran firmware 13.42's _WStoul (JhVR7D4Ax6Y): the decrypted system libSceLibcInternal.sprx's export, natively on a PC (not a console), with errno cleared and the end pointer pre-set before each call. Three identical runs.
" 1"with base 1, 37 and -2,"1"with base 1,"Z"with base 37 and" 1"with base 100 all return 0, leave the end pointer at the start of the string and leaveerrnoat 0. That is what the newCheckStoulrows require.- Controls in the same run:
" 1"base 10 gives 1 (end after 2 characters)," ff"base 16 gives 255,"0x1f"base 0 gives 31,"zz"base 36 gives 1295, and an overflowing decimal givesULLONG_MAXwitherrno34, so the end pointer anderrnoare both observed.
So the debt entry's "unverified on the console" can say that firmware 13.42's system module does the same, if you want to cite it.
|
@dwk001 a merge-order question: a maintainer asked the authors of #12514 ( Proposed order: this PR lands first, and #12514 rebases afterwards (#12514 will declare it in Depends on). Your PR needs no changes. Could you confirm that order works for you, or say if you'd rather #12514 went first? AI-assisted: yes (Claude Code). |
Confirmed, that order works for me: #10729 first, then #12514 rebases on top. Thanks for coordinating |
# Conflicts: # docs/dev/debt/libc.md
What
_WStoulthrewstd::invalid_argumentfor a base other than 0 or 2 to 36. It now passes every base towcstoul, which returns 0, stores the start of the string in the end pointer and leaveserrnounchanged, as Dinkumware'sxstoul.cdoes. Unverified on the console; noted indocs/dev/debt/libc.md.Tested
Linux, full build with
-DBUILD_TESTING=ON:ctest --test-dir build -R guest_wide_conversionpasses with cases for bases 1, 37 and -2.tools/check_conventions.py --base origin/mainreports one warning: the existing_WStoul/_Iswctype/swscanfdebt entry was already over the 1000-character limit on main.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)