libc: treat negative dynamic printf precision as omitted #625
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!625
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/625/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Mininaut on GitHub · 2026-09-15 17:29 UTC · original
Mininaut:fix/guest-printf-negative-precision-minimal→main· +6 −1 · 1 files · 1 commits · merged 2026-09-17 11:18 UTCTreat negative
.*precision as omitted by clearingFLAGS_PRECISION. For example,%.*swith precision-1now prints the full string; zero and positive precision keep their existing behavior.moved from #503.
Summary by CodeRabbit
@coderabbitai[bot] on GitHub · 2026-09-15 17:29 UTC · original · edited 2026-09-15 17:40 UTC
📝 Walkthrough
Walkthrough
Dynamic precision parsing now disables precision handling for negative
*values and preserves nonnegative values as unsigned precision.Changes
Dynamic precision handling
src/libs/guestPrintf.cppFLAGS_PRECISION. Nonnegative precision values are converted to unsigned values.Priority: ⬇️ Low
Estimated code review effort: 1 (Trivial) | ~5 minutes
Change: Bug fix
Suggested reviewers:
nmzikMerge Risk: 🔵 Low · up to
6d927The implementation is correct, but missing regression assertions could allow future changes to silently alter formatted output. The remaining merge risk is low and bounded by adding focused tests.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment
@coderabbitai helpto get the list of available commands.@ -531,0 +532,4 @@flags &= ~FLAGS_PRECISION;} else {precision = static_cast<unsigned int>(prec);}@coderabbitai[bot] on GitHub · 2026-09-15 17:37 UTC · original
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Add focused dynamic-precision assertions. The shared parser is reachable through the guest
printf,vprintf, andsnprintfentrypoints, but no test calls those entrypoints with negative, zero, and positive.*arguments. The only matching test uses a positive%.*sprecision. A regression at these lines can therefore escape the existing tests.🤖 Prompt for AI Agents
@coderabbitai[bot] on GitHub · 2026-09-15 17:37 UTC · original · reviewed
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Advanced
Run ID:
08af6578-8271-4309-a655-9743ca0f823b📥 Commits
Reviewing files that changed from the base of the PR and between
6a2987a7b2and6d927f1de1.📒 Files selected for processing (1)
src/libs/guestPrintf.cppIncluded review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.