Repository navigation
Documentation: Add a page on printf. - #21506
Merged
Merged
Conversation
casaroli
force-pushed
the
printf-doc-up
branch
from
November 6, 2026 07:44
e80168c to
50559c4
Compare
|
casaroli
force-pushed
the
printf-doc-up
branch
3 times, most recently
from
November 8, 2026 13:11
c073cc9 to
71fadff
Compare
xiaoxiang781216
previously approved these changes
Nov 8, 2026
5 tasks done
The page explains how printf() works in NuttX: each conversion, flag, length, width and precision with examples and their output, each option and profile and what it prints when it is off, what happens on an unknown conversion and on a truncated format, what is correct and wrong usage, the flash and stack cost, and what is outside the guarantee. It describes the code of apache#21505 and apache#21507: the options LIBC_PRINTF_HEXFLOAT, LIBC_PRINTF_C23, LIBC_PRINTF_PERCENT_N, LIBC_PRINTF_EXACT and LIBC_PRINTF_EXACT_LDOUBLE, and %e, %f and %g with 17 significant digits and no floating point operation. The output in the examples comes from a run of the same calls on NuttX, in Default and in Full. Part of apache#21467 Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Marco Casaroli <[email protected]>
casaroli
force-pushed
the
printf-doc-up
branch
from
November 8, 2026 18:06
71fadff to
f7fbfa9
Compare
xiaoxiang781216
approved these changes
Nov 9, 2026
casaroli
marked this pull request as ready for review
November 9, 2026 05:06
acassis
approved these changes
Nov 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One commit: the page only. It describes the code of #21505 and #21507, both merged. Part of #21467, step 5.
Summary
A new page,
Documentation/os/libs/libc/printf.rst, linked from the libc index. It explains howprintfworks in NuttX:LIBC_PRINTF_EXACTandLIBC_PRINTF_EXACT_LDOUBLEof libs/libc/stream: Print floating point on the bits with integers in printf(). #21507.?for a conversion that is off.Impact
Documentation only. No code changes.
Testing
Each example is real: the output on the page comes from a run of the same calls on NuttX,
rv-virt:nshunder QEMU, with the Full profile, and with all options off for the table of what a feature prints when it is off. The examples and the size tables come from #21507 at 374a600, the head with the%#g,*andfprintf()fixes: 5 profiles run, 32 size builds.sphinx-build -M html . _build -W --keep-goingwith Sphinx 6.2.1 from the Pipfile: no warning from this page. The one warning of the run isplantuml command cannot be runin another page: this host has noplantuml. After the move to master as one commit (the page of #21506 and the update of #21507 together),sphinx-build -b html -Wof the page withstream.rst: no warning.