[FEATURE] Add native integer printf formatting and diagnostics #13
Labels
No labels
alpha-1
bug
ci
docs
duplicate
enhancement
help wanted
invalid
performance
phase-6
question
refactor
security
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
erix/coreutils#13
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Problem and motivation
Native printf handles byte and string output, but build scripts also need integer formatting and useful diagnostics for malformed numbers.
Proposed behavior and scope
Add %d, %i, %u, %o, %x and %X with integer flags and literal decimal width and precision. Document signs, bases, quoted operands and numeric bounds under a fixed C byte policy. Preserve format reuse, missing operands, binary output and the existing %b command stop.
Numeric operand errors must retain converted output, report diagnostics and finish with status 2. Reachable malformed format syntax still fails before output. Extend the shared formatter and native consumer together; provide an explicit diagnostic buffer for buffered callers.
Authority, security and reliability
Use the original argument view and admitted stdout/stderr descriptions. Parsing and rendering acquire no allocation, locale, environment or service authority. Keep generated, staged and accepted bytes separate for each stream, including callback failures and cleanup uncertainty.
Acceptance criteria
Alternatives and tradeoffs
The stdout-only buffered interface cannot represent numeric diagnostics. An explicit diagnostic-output interface keeps one parser for buffered and native callers; the legacy interface must refuse diagnostic-producing input rather than discard errors.
Tracking and rollout
Extends the byte/string formatter in #12. Coordinate Coreutils and Integration through #2 and erix/integration#12. Phase tracking: erix/integration#65.