Repository navigation
libs/libc/stream: Fix the shadowed len in vsprintf_internal(). - #21210
Merged
Merged
Conversation
fee2c2e ("libc/stdio: Batch vsprintf literal output") added two inner variables `size_t len`, which shadow the `unsigned char len` of vsprintf_internal(). arm64 builds with -Wshadow -Werror (arch/arm64/src/Toolchain.defs), so every arm64 build failed: stream/lib_libvsprintf.c:219:26: error: declaration of 'len' shadows a previous local [-Werror=shadow] Rename the two inner variables to litlen. No functional change. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Marco Casaroli <[email protected]>
|
xiaoxiang781216
approved these changes
Oct 30, 2026
This was referenced Oct 30, 2026
JianyuWang0623
approved these changes
Oct 30, 2026
acassis
approved these changes
Oct 30, 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.
Summary
fee2c2e ("libc/stdio: Batch vsprintf literal output", #21072) added two inner variables
size_t leninvsprintf_internal(), which shadow theunsigned char lenof the function. arm64 builds with-Wshadow -Werror(arch/arm64/src/Toolchain.defs), so every arm64 build of master fails:This PR renames the two inner variables to
litlen. No functional change.Impact
Build fix only: a rename of two local variables, all build modes and architectures.
Testing
Before (master 8773241), qemu-armv8a:nsh: the build fails with the two errors above.
After, with this PR (QEMU with HVF):
printflit.cchecks literal text,%%and padding (the output paths that libc/stdio: Batch vsprintf output #21072 changed) withsnprintf()against the C standard results: 8 of 8 PASS ("plain text only","%","a%b%%c","x42y","[ 42][42 ][00042]","[ ab][ab ]", a 40-wide field,"s%c end").CONFIG_LIBC_NUMBERED_ARGS=y(the other branch of the changed code): builds, no warning inlib_libvsprintf.c.-Wshadowwithout-Werror): builds, no warning inlib_libvsprintf.c.tools/checkpatch.sh -c -u -m -gpasses.