Skip to content

Commit 035c0ca

Browse files
committed
cmake: Enable more MSVC warnings
These warnings are automatically enabled by MSVC when doing LTO so we may as well enable them all the time.
1 parent b937eae commit 035c0ca

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,14 @@ elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang" AND NOT MSVC)
173173
endif()
174174
endif()
175175
elseif(MSVC)
176+
# A unary minus operator was applied to an unsigned type, resulting in an unsigned result.
177+
add_compile_options(/W14146)
178+
# A negative integral constant converted to unsigned type, resulting in a possibly meaningless result.
179+
add_compile_options(/W14308)
180+
# Use of an uninitialized local variable.
181+
add_compile_options(/W14700)
182+
# Use of a potentially uninitialized local pointer variable.
183+
add_compile_options(/W14703)
176184
if(NOT ENABLE_RTTI)
177185
add_compile_options(/GR-) # Disable RTTI
178186
endif()

0 commit comments

Comments
 (0)