huojianchaoyy opened a new pull request, #4191:
URL: https://github.com/apache/nuttx-apps/pull/4191

   *Note: Please adhere to [Contributing 
Guidelines](https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md).*
   
   ## Summary
   
   Follow-up to #4136, from @cederom's review there.
   
   - **testing/mm/kasantest: pass the GCC-only flags to all but Clang**: #4136 
added `-Wno-use-after-free -Wno-stringop-overflow` only when 
`CONFIG_ARCH_TOOLCHAIN_GCC` is set. Not every GCC toolchain selects that 
symbol: the RISC-V GNU toolchains (`RISCV_TOOLCHAIN_GNU_RV64`, `_RV32`, 
`_RV64ILP32`) select only `ARCH_TOOLCHAIN_GNU`, and x86_64, mips and others 
select none, so those builds lost the two flags. Leave them out only for the 
Clang and armclang toolchains, the compilers that do not know them. The 
comments now say that Clang warns about the unknown `-Wno-` options instead of 
rejecting them, and how GCC treats `-Wno-unknown-warning-option`.
   
   ## Impact
   
   kasantest build flags only. GCC builds on RISC-V and the arches without a 
toolchain symbol get the two `-Wno-` flags back. Clang and armclang builds are 
unchanged, and so are the arches that select `ARCH_TOOLCHAIN_GCC`.
   
   ## Testing
   
   Host: Ubuntu 22.04 (Linux 6.8, x86_64), CMake 3.23 with Ninja, GCC 13.4 
(aarch64-none-elf, riscv-none-elf), Clang 21.1.8. Base: apps master 9a2c689, 
nuttx master 8cf5ce2.
   
   `./tools/checkpatch.sh -c -u -m -g HEAD~1..HEAD` passes.
   
   `CONFIG_MM_KASAN=y` and `CONFIG_TESTING_KASAN=y`. For each build I checked 
whether the kasantest.c compile line has the flags:
   
   | board:config | toolchain | build | `-Wno-use-after-free` on kasantest.c |
   |---|---|---|---|
   | qemu-armv8a:nsh (CMake) | aarch64-none-elf-gcc 13.4 | OK | yes |
   | rv-virt:nsh (CMake) | riscv-none-elf-gcc 13.4 | OK | yes (missing before 
this change) |
   | rv-virt:nsh (Make, `V=1`) | riscv-none-elf-gcc 13.4 | OK | yes (missing 
before this change) |
   | sim:nsh, `CONFIG_SIM_TOOLCHAIN_CLANG` (CMake) | clang 21.1.8 | OK | no, 
and no `unknown warning option` warnings |
   
   Not tested: armclang, x86_64, mips.
   


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