From cecc823cd0ebedc4dfc4fbb926a680c13758eae8 Mon Sep 17 00:00:00 2001 From: "Alexander \"Ace\" Olofsson" Date: Tue, 13 Mar 2012 21:55:50 +0100 Subject: [PATCH 1/6] Commented list of disabled warnings to start with --- CMakeLists.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ca747f9a5..3283a4151 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -418,6 +418,20 @@ if (WIN32) set_target_properties(openmw PROPERTIES LINK_FLAGS_RELEASE "/SUBSYSTEM:CONSOLE") set_target_properties(openmw PROPERTIES COMPILE_DEFINITIONS_RELEASE "_CONSOLE") set_target_properties(openmw PROPERTIES LINK_FLAGS_MINSIZEREL "/SUBSYSTEM:CONSOLE") + + # Play a bit with the warning levels + set(WARNINGS_DISABLE + 4099 # Type mismatch, forward definition of a class is really a struct + 4244 4305 # Storing value of one type in variable of another + 4309 # Variable overflow, trying to store 128 in a char for example + ) + + foreach(d ${WARNINGS_DISABLE}) + set(WARNINGS "${WARNINGS} /wd${d}") + endforeach(d) + set_target_properties(components PROPERTIES COMPILE_FLAGS ${WARNINGS}) + set_target_properties(omwlauncher PROPERTIES COMPILE_FLAGS ${WARNINGS}) + set_target_properties(openmw PROPERTIES COMPILE_FLAGS ${WARNINGS}) endif(MSVC) # Same for MinGW From 2f11bfc9849f94cabd6e2f8532c8065be0591f9f Mon Sep 17 00:00:00 2001 From: "Alexander \"Ace\" Olofsson" Date: Tue, 13 Mar 2012 22:47:39 +0100 Subject: [PATCH 2/6] I think I've added all the warnings now --- CMakeLists.txt | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3283a4151..333f06a68 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -420,15 +420,33 @@ if (WIN32) set_target_properties(openmw PROPERTIES LINK_FLAGS_MINSIZEREL "/SUBSYSTEM:CONSOLE") # Play a bit with the warning levels + + set(WARNINGS "/Wall") # Since windows can only disable specific warnings, not enable them + set(WARNINGS_DISABLE - 4099 # Type mismatch, forward definition of a class is really a struct - 4244 4305 # Storing value of one type in variable of another - 4309 # Variable overflow, trying to store 128 in a char for example + # Some unneeded and sometimes completely retarded warnings that /Wall enables + 4820 4514 4710 4986 4668 4625 4626 4571 4640 4548 4512 4350 4917 4619 4061 + 4623 4263 4264 4266 4996 4347 4628 4510 4610 + + 4099 # Type mismatch, declared class or struct defined with other type + 4100 # Unreferenced formal parameter (-Wunused-parameter) + 4127 # Conditional expression is constant + 4146 # Unary minus on unsigned type, result still unsigned + 4242 # Storing value in a variable of a smaller type, possible loss of data + 4244 # Storing value of one type in variable of another (double in float, size_t in int, etc.) + 4265 # Class has virtual functions but no virtual desctructor (-Wnon-virtual-dtor) + 4305 # Truncating value (double -> float for example) + 4309 # Variable overflow, trying to store 128 in a char for example + 4355 # Using 'this' in member initialization list + 4365 # Variable signed/unsigned mismatch + 4701 # Potentially uninitialized local variable used + 4702 # Unreachable code ) foreach(d ${WARNINGS_DISABLE}) set(WARNINGS "${WARNINGS} /wd${d}") endforeach(d) + set_target_properties(components PROPERTIES COMPILE_FLAGS ${WARNINGS}) set_target_properties(omwlauncher PROPERTIES COMPILE_FLAGS ${WARNINGS}) set_target_properties(openmw PROPERTIES COMPILE_FLAGS ${WARNINGS}) From e7c3ddfe40d0501c81df3ebb5f527553d87799c9 Mon Sep 17 00:00:00 2001 From: "Alexander \"Ace\" Olofsson" Date: Tue, 13 Mar 2012 23:04:33 +0100 Subject: [PATCH 3/6] Final warning changes --- CMakeLists.txt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 333f06a68..fb4d3bc6b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -425,18 +425,20 @@ if (WIN32) set(WARNINGS_DISABLE # Some unneeded and sometimes completely retarded warnings that /Wall enables - 4820 4514 4710 4986 4668 4625 4626 4571 4640 4548 4512 4350 4917 4619 4061 - 4623 4263 4264 4266 4996 4347 4628 4510 4610 + 4061 4263 4264 4266 4347 4350 4510 4512 4514 4548 4571 4610 4619 4623 4625 + 4626 4628 4640 4668 4706 4710 4820 4826 4917 4946 4986 4996 + # Not going to bother commenting them as they tend to warn on even standard library files - 4099 # Type mismatch, declared class or struct defined with other type + 4099 # Type mismatch, declared class or struct is defined with other type 4100 # Unreferenced formal parameter (-Wunused-parameter) + 4101 # Unreferenced local variable 4127 # Conditional expression is constant 4146 # Unary minus on unsigned type, result still unsigned 4242 # Storing value in a variable of a smaller type, possible loss of data - 4244 # Storing value of one type in variable of another (double in float, size_t in int, etc.) + 4244 # Storing value of one type in variable of another (size_t in int, for example) 4265 # Class has virtual functions but no virtual desctructor (-Wnon-virtual-dtor) - 4305 # Truncating value (double -> float for example) - 4309 # Variable overflow, trying to store 128 in a char for example + 4305 # Truncating value (double to float, for example) + 4309 # Variable overflow, trying to store 128 in a signed char for example 4355 # Using 'this' in member initialization list 4365 # Variable signed/unsigned mismatch 4701 # Potentially uninitialized local variable used From ac0ba0c2734f11fae884c352d30154dcd9382c31 Mon Sep 17 00:00:00 2001 From: "Alexander \"Ace\" Olofsson" Date: Tue, 13 Mar 2012 23:51:48 +0100 Subject: [PATCH 4/6] A little bit more commenting and sorting out the "normally not enabled" warnings --- CMakeLists.txt | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fb4d3bc6b..bc0c63671 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -424,11 +424,19 @@ if (WIN32) set(WARNINGS "/Wall") # Since windows can only disable specific warnings, not enable them set(WARNINGS_DISABLE - # Some unneeded and sometimes completely retarded warnings that /Wall enables - 4061 4263 4264 4266 4347 4350 4510 4512 4514 4548 4571 4610 4619 4623 4625 - 4626 4628 4640 4668 4706 4710 4820 4826 4917 4946 4986 4996 - # Not going to bother commenting them as they tend to warn on even standard library files - + # Warnings that aren't enabled normally and don't need to be enabled + # They're unneeded and sometimes completely retarded warnings that /Wall enables + # Not going to bother commenting them as they tend to warn on every standard library files + 4061 4263 4264 4266 4350 4514 4548 4571 4610 4619 4623 4625 4626 4628 4640 4668 4710 4820 4826 4917 4946 + + # Warnings that are thrown on standard libraries and not OpenMW + 4347 # Non-template function with same name and parameter count as template function + 4510 4512 # Unable to generate copy constructor/assignment operator as it's not public in the base + 4706 # Assignment in conditional expression + 4986 # Undocumented warning that occurs in the crtdbg.h file + 4996 # Function was declared deprecated + + # OpenMW specific warnings 4099 # Type mismatch, declared class or struct is defined with other type 4100 # Unreferenced formal parameter (-Wunused-parameter) 4101 # Unreferenced local variable From 477525ee48b30f33f55572a5efcb312cb53c3a0e Mon Sep 17 00:00:00 2001 From: "Alexander \"Ace\" Olofsson" Date: Wed, 14 Mar 2012 11:36:13 +0100 Subject: [PATCH 5/6] Minor modification and spelling correction --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bc0c63671..8091b11d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -431,6 +431,7 @@ if (WIN32) # Warnings that are thrown on standard libraries and not OpenMW 4347 # Non-template function with same name and parameter count as template function + 4365 # Variable signed/unsigned mismatch 4510 4512 # Unable to generate copy constructor/assignment operator as it's not public in the base 4706 # Assignment in conditional expression 4986 # Undocumented warning that occurs in the crtdbg.h file @@ -444,11 +445,10 @@ if (WIN32) 4146 # Unary minus on unsigned type, result still unsigned 4242 # Storing value in a variable of a smaller type, possible loss of data 4244 # Storing value of one type in variable of another (size_t in int, for example) - 4265 # Class has virtual functions but no virtual desctructor (-Wnon-virtual-dtor) + 4265 # Class has virtual functions but no virtual destructor (-Wnon-virtual-dtor) 4305 # Truncating value (double to float, for example) 4309 # Variable overflow, trying to store 128 in a signed char for example 4355 # Using 'this' in member initialization list - 4365 # Variable signed/unsigned mismatch 4701 # Potentially uninitialized local variable used 4702 # Unreachable code ) From 04494893c8cc95c5d7dfd0e33824860c965dd41d Mon Sep 17 00:00:00 2001 From: "Alexander \"Ace\" Olofsson" Date: Thu, 15 Mar 2012 14:10:12 +0100 Subject: [PATCH 6/6] Added some release mode warnings --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8091b11d5..0f65ea122 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -427,13 +427,14 @@ if (WIN32) # Warnings that aren't enabled normally and don't need to be enabled # They're unneeded and sometimes completely retarded warnings that /Wall enables # Not going to bother commenting them as they tend to warn on every standard library files - 4061 4263 4264 4266 4350 4514 4548 4571 4610 4619 4623 4625 4626 4628 4640 4668 4710 4820 4826 4917 4946 + 4061 4263 4264 4266 4350 4514 4548 4571 4610 4619 4623 4625 4626 4628 4640 4668 4710 4711 4820 4826 4917 4946 # Warnings that are thrown on standard libraries and not OpenMW 4347 # Non-template function with same name and parameter count as template function 4365 # Variable signed/unsigned mismatch 4510 4512 # Unable to generate copy constructor/assignment operator as it's not public in the base 4706 # Assignment in conditional expression + 4738 # Storing 32-bit float result in memory, possible loss of performance 4986 # Undocumented warning that occurs in the crtdbg.h file 4996 # Function was declared deprecated