casaroli opened a new pull request, #21210:
URL: https://github.com/apache/nuttx/pull/21210

   ## Summary
   
   fee2c2e9705 ("libc/stdio: Batch vsprintf literal output", #21072) added two 
inner variables `size_t len` in `vsprintf_internal()`, which shadow the 
`unsigned char len` of the function. arm64 builds with `-Wshadow -Werror` 
(`arch/arm64/src/Toolchain.defs`), so every arm64 build of master fails:
   
   ```
   stream/lib_libvsprintf.c:219:26: error: declaration of 'len' shadows a 
previous local [-Werror=shadow]
   stream/lib_libvsprintf.c:232:22: error: declaration of 'len' shadows a 
previous local [-Werror=shadow]
   ```
   
   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 8773241554a), qemu-armv8a:nsh: the build fails with the two 
errors above.
   
   After, with this PR (QEMU with HVF):
   
   - qemu-armv8a:knsh (kernel build): ostest exits with status 0; a test 
program `printflit.c` checks literal text, `%%` and padding (the output paths 
that #21072 changed) with `snprintf()` 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"`).
   - qemu-armv8a:nsh (flat build): ostest exits with status 0.
   - qemu-armv8a:nsh with `CONFIG_LIBC_NUMBERED_ARGS=y` (the other branch of 
the changed code): builds, no warning in `lib_libvsprintf.c`.
   - mps2-an500:nsh (32-bit Arm, `-Wshadow` without `-Werror`): builds, no 
warning in `lib_libvsprintf.c`.
   
   `tools/checkpatch.sh -c -u -m -g` passes.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to