Kaben123 opened a new pull request, #22576: URL: https://github.com/apache/nuttx/pull/22576
## Summary MISRA C-2012 Rule 10.4 fix in `include/strings.h`: in the `CONFIG_HAVE_BUILTIN_CLZ` versions of `fls()`, `flsl()` and `flsll()`, the signed constant `8` was mixed with the unsigned `sizeof()`, and the signed result of `__builtin_clz*()` was subtracted from an unsigned value. Use `8u` and cast the builtin result to `size_t`. ## Impact None at runtime: the expressions already had type `size_t`, and `__builtin_clz*()` never returns a negative value. No API or Kconfig change. ## Testing Host: Ubuntu 22.04.5 x86_64, GCC 13.1.0, arm-none-eabi-gcc 13.2.1. Base: apache/nuttx master 75b4dc85275, apache/nuttx-apps master 9a2c68962. Builds without new warnings, Make: `sim:nsh`, `stm32f4discovery:nsh`; CMake: `sim:nsh`. `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]
