yangsong8-a1 opened a new pull request, #22161:
URL: https://github.com/apache/nuttx/pull/22161

   ## Summary
     
     Fix the `-Werror=format` build failure in `fdt_cfi_register()` on
     aarch64: the `ferr()` call printed a `size_t` with `%d` and two
     `uintptr_t` with `%x`, which are 64-bit there.  The first commit uses
     `%zu` for the index; the second prints the addresses with `PRIxPTR`.
     
     ## Impact
     
     Diagnostic-only change (error-path `ferr` format string).  No functional
     change.
     
     ## Testing
     
     Ubuntu 22.04, aarch64-none-elf-gcc 13.2.Rel1.
     
     Build failure on master (`qemu-armv8a:nsh` + `CONFIG_MTD=y`,
     `CONFIG_MTD_CFI=y`):
     
   drivers/devicetree/fdt_cfi.c:92:20: error: format '%d' expects argument of 
type 'int', but argument 3 has type 'size_t' {aka 'long unsigned int'}
     [-Werror=format=]
    drivers/devicetree/fdt_cfi.c:92:20: error: format '%x' expects argument of 
type 'unsigned int', but argument 4 has type 'uintptr_t' {aka 'long
     unsigned int'} [-Werror=format=]
    drivers/devicetree/fdt_cfi.c:92:20: error: format '%x' expects argument of 
type 'unsigned int', but argument 5 has type 'uintptr_t' {aka 'long
     unsigned int'} [-Werror=format=]
     
     With the fix the same configuration builds, and qemu-armv7a:full
     (32-bit, MTD_CFI and DEVICE_TREE) also builds with no warnings.


-- 
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]

  • [PR] fdt_cfi: fix printf form... yangsong8-a1 (via GitHub) via commits

Reply via email to