Skip to content

Commit 5e4c61f

Browse files
committed
MSVC warnings set to level 4
Reading up a bit more, MSVC /Wall (enable all warnings) turns on a bunch of informative and often not useful messages. Better to just set the warning level to 4, one notch down. This only reports one warning that we want to disable: not using a function parameter.
1 parent 1b8b4e4 commit 5e4c61f

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

CMakeLists.txt

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -95,24 +95,12 @@ include_directories(src)
9595
message (STATUS "Compiler ID: " ${CMAKE_CXX_COMPILER_ID})
9696

9797
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
98-
# /we #### - treat warning as error
9998
# /wd #### - Disable warning
100-
# /w3 #### - set warning to level 3
101-
add_compile_options("/Wall") # Enable all warnings
102-
add_compile_options("/w3 5038") # Data member will be initialized after [other] data member
99+
# /we #### - treat warning as error
100+
add_compile_options("/W4") # Enable level-4 warnings
103101
add_compile_options("/we 4265") # Class has virtual functions, but its non-trivial destructor is not virtual
104102
add_compile_options("/we 5204") # Class has virtual functions, but its trivial destructor is not virtual
105103
add_compile_options("/wd 4100") # unreferenced formal parameter
106-
add_compile_options("/wd 4365") # conversion from 'size_t' to 'const int __int64', signed/unsigned mismatch
107-
add_compile_options("/wd 4514") # Ureferenced inline function has been removed
108-
add_compile_options("/wd 4626") # assignment operator was implicitly defined as deleted
109-
add_compile_options("/wd 4710") # Function not inlined
110-
add_compile_options("/wd 4711") # Function selected for automatic inline expansion
111-
add_compile_options("/wd 4820") # N bytes padding added after data member
112-
add_compile_options("/wd 5027") # move assignment operator was implicitly defined as deleted
113-
add_compile_options("/wd 5045") # will insert Spectre mitigation for memory load if /Qspectre switch specified
114-
add_compile_options("/wd 5219") # implicit conversion from 'unsigned __int64' to 'double', possible loss of data
115-
add_compile_options("/wd 5267") # definition of implicit assignment operator is deprecated; has user-provided dtor
116104
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
117105
add_compile_options(-Wnon-virtual-dtor) # Class has virtual functions, but its destructor is not virtual
118106
add_compile_options(-Wreorder) # Data member will be initialized after [other] data member

0 commit comments

Comments
 (0)