Skip to content

Commit a8862d9

Browse files
remove all wd flag to enable warnings when LLVM_ENABLE_WARNINGS is ON
Signed-off-by: Zhu, Shaojie <[email protected]>
1 parent 723d079 commit a8862d9

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

llvm/cmake/modules/HandleLLVMOptions.cmake

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -701,8 +701,6 @@ if ( LLVM_COMPILER_IS_GCC_COMPATIBLE AND LLVM_ENABLE_MODULES )
701701
append("${module_flags}" CMAKE_CXX_FLAGS)
702702
endif( LLVM_COMPILER_IS_GCC_COMPATIBLE AND LLVM_ENABLE_MODULES )
703703

704-
option(LLVM_ENABLE_WARNINGS_FOR_PASS_BINSKIM "Enable compiler warnings for pass binskim." OFF)
705-
706704
if (MSVC)
707705
if (NOT CLANG_CL)
708706
set(msvc_warning_flags
@@ -765,15 +763,18 @@ if (MSVC)
765763
)
766764
endif(NOT CLANG_CL)
767765

768-
# Remove -wd4146 -wd4244 -wd4267 to pass Binskim
769-
if(LLVM_ENABLE_WARNINGS_FOR_PASS_BINSKIM)
770-
string(REPLACE "-wd4146" "" msvc_warning_flags "${msvc_warning_flags}")
771-
string(REPLACE "-wd4244" "" msvc_warning_flags "${msvc_warning_flags}")
772-
string(REPLACE "-wd4267" "" msvc_warning_flags "${msvc_warning_flags}")
773-
endif()
774-
775766
# Enable warnings
776767
if (LLVM_ENABLE_WARNINGS)
768+
# Remove all -wd flag to enable warnings
769+
if (NOT CLANG_CL)
770+
set(msvc_warning_flags
771+
# Promoted warnings.
772+
-w14062 # Promote 'enumerator in switch of enum is not handled' to level 1 warning.
773+
774+
# Promoted warnings to errors.
775+
-we4238 # Promote 'nonstandard extension used : class rvalue used as lvalue' to error.
776+
)
777+
endif(NOT CLANG_CL)
777778
# Put /W4 in front of all the -we flags. cl.exe doesn't care, but for
778779
# clang-cl having /W4 after the -we flags will re-enable the warnings
779780
# disabled by -we.

0 commit comments

Comments
 (0)