aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Hunt <oliver@apple.com>2025-05-13 19:58:08 -0700
committerOliver Hunt <oliver@apple.com>2025-05-13 19:58:08 -0700
commit9c28f07d03e07fd7d65f35bb6411fabd0df64d6f (patch)
treef0245798d32012f6de4ae29a7036f77c1a5b0f27
parent7460056a81fbf897fecfaaae7aa8cc515599ea97 (diff)
downloadllvm-users/ojhunt/enable-ms-bitfield-padding.zip
llvm-users/ojhunt/enable-ms-bitfield-padding.tar.gz
llvm-users/ojhunt/enable-ms-bitfield-padding.tar.bz2
Add -Wms-bitfield-padding warning when possibleusers/ojhunt/enable-ms-bitfield-padding
-rw-r--r--llvm/cmake/modules/HandleLLVMOptions.cmake4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
index c427a65e..fa476c1 100644
--- a/llvm/cmake/modules/HandleLLVMOptions.cmake
+++ b/llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -935,6 +935,10 @@ if (LLVM_ENABLE_WARNINGS AND (LLVM_COMPILER_IS_GCC_COMPATIBLE OR CLANG_CL))
# Enable -Wctad-maybe-unsupported to catch unintended use of CTAD.
add_flag_if_supported("-Wctad-maybe-unsupported" CTAD_MAYBE_UNSPPORTED_FLAG)
+
+ # Enable -Wms-bitfield-padding to catch padding problems when compiling with
+ # msvc
+ add_flag_if_supported("-Wms-bitfield-padding" MS_BITFIELD_PADDING_FLAG)
endif (LLVM_ENABLE_WARNINGS AND (LLVM_COMPILER_IS_GCC_COMPATIBLE OR CLANG_CL))
if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND NOT LLVM_ENABLE_WARNINGS)