[all-commits] [llvm/llvm-project] 4a907a: [CMake] Add LLVM_ENABLE_WARNING_SUPPRESSIONS to to...
Shaojie Zhu via All-commits
all-commits at lists.llvm.org
Mon Mar 2 05:44:26 PST 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 4a907a526dd735acf7433be2cbddb30d48e96095
https://github.com/llvm/llvm-project/commit/4a907a526dd735acf7433be2cbddb30d48e96095
Author: Shaojie Zhu <shaojie.zhu at intel.com>
Date: 2026-03-02 (Mon, 02 Mar 2026)
Changed paths:
M llvm/cmake/modules/HandleLLVMOptions.cmake
M llvm/cmake/modules/LLVMConfig.cmake.in
M llvm/docs/CMake.rst
Log Message:
-----------
[CMake] Add LLVM_ENABLE_WARNING_SUPPRESSIONS to toggle warning suppressions (#183439)
This PR introduces a new opt-in CMake option
`LLVM_ENABLE_WARNING_SUPPRESSIONS` (default `ON`) to toggle warning
suppressions
Previously, several compiler warnings were explicitly disabled using
`-wd` (for MSVC) or `-Wno-...` (for GCC/Clang) flags by default.
However, this causes validation failures with strict compliance scanners
like BinSkim, which require builds to run without any warning
suppressions to meet SDL compliance standards.
This change introduces an opt-in `LLVM_ENABLE_WARNING_SUPPRESSIONS`
option (default ON). When explicitly disabled (OFF), it selectively
filters out the `-wd` flags for MSVC and removes all `-Wno-...` flags
for GCC/Clang in HandleLLVMOptions.cmake. This ensures all compiler
warnings are exposed as intended for static analysis tools while
preserving the default noise-free build experience for regular users.
The option has also been exported to `LLVMConfig.cmake.in` and
documented in `CMake.rst`.
Signed-off-by: Zhu, Shaojie <shaojie.zhu at intel.com>
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list