From 0d5b581fcd07c0bb61373abd6b0404215c0b2301 Mon Sep 17 00:00:00 2001 From: Diusrex Date: Sun, 5 Jan 2014 14:42:22 -0700 Subject: Making all of the useful level 4 warnings be active. --- src/Globals.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/Globals.h') diff --git a/src/Globals.h b/src/Globals.h index 58badf4dd..6a9b2050d 100644 --- a/src/Globals.h +++ b/src/Globals.h @@ -14,7 +14,19 @@ #pragma warning(disable:4481) // Disable some warnings that we don't care about: - #pragma warning(disable:4100) + #pragma warning(disable:4100) // Unreferenced formal parameter + + // Useful warnings from warning level 4: + #pragma warning(3 : 4189) // Local variable is initialized but not referenced + #pragma warning(3 : 4702) // Unreachable code + #pragma warning(3 : 4245) // Conversion from 'type1' to 'type2', signed/unsigned mismatch + #pragma warning(3 : 4389) // Signed/unsigned mismatch + #pragma warning(3 : 4701) // Potentially unitialized local variable used + #pragma warning(3 : 4244) // Conversion from 'type1' to 'type2', possible loss of data + #pragma warning(3 : 4310) // Cast truncates constant value + #pragma warning(3 : 4505) // Unreferenced local function has been removed + #pragma warning(3 : 4127) // Conditional expression is constant + #pragma warning(3 : 4706) // Assignment within conditional expression #define OBSOLETE __declspec(deprecated) -- cgit v1.2.3 From 1acbf07445d4dbd2d8badd3a4be709ebc4cb2a3e Mon Sep 17 00:00:00 2001 From: Diusrex Date: Sun, 5 Jan 2014 15:07:46 -0700 Subject: Changed the release version of ASSERT. This was so a variable only used in ASSERT statements will not give a warning about not being used. --- src/Globals.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Globals.h') diff --git a/src/Globals.h b/src/Globals.h index 6a9b2050d..a761da404 100644 --- a/src/Globals.h +++ b/src/Globals.h @@ -204,7 +204,7 @@ typedef unsigned short UInt16; #ifdef _DEBUG #define ASSERT( x ) ( !!(x) || ( LOGERROR("Assertion failed: %s, file %s, line %i", #x, __FILE__, __LINE__ ), assert(0), 0 ) ) #else - #define ASSERT(x) ((void)0) + #define ASSERT(x) ((void)(x)) #endif // Pretty much the same as ASSERT() but stays in Release builds -- cgit v1.2.3 From 778c329ad2ff9af5595b695fc264b9fc2ad3d538 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Mon, 6 Jan 2014 22:23:03 +0100 Subject: Disabled the type conversion MSVC warning. It was hitting way too many false positives. --- src/Globals.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/Globals.h') diff --git a/src/Globals.h b/src/Globals.h index a761da404..1765c53d8 100644 --- a/src/Globals.h +++ b/src/Globals.h @@ -22,11 +22,13 @@ #pragma warning(3 : 4245) // Conversion from 'type1' to 'type2', signed/unsigned mismatch #pragma warning(3 : 4389) // Signed/unsigned mismatch #pragma warning(3 : 4701) // Potentially unitialized local variable used - #pragma warning(3 : 4244) // Conversion from 'type1' to 'type2', possible loss of data #pragma warning(3 : 4310) // Cast truncates constant value #pragma warning(3 : 4505) // Unreferenced local function has been removed #pragma warning(3 : 4127) // Conditional expression is constant #pragma warning(3 : 4706) // Assignment within conditional expression + + // 2014_01_06 xoft: Disabled this warning because MSVC is stupid and reports it in obviously wrong places + // #pragma warning(3 : 4244) // Conversion from 'type1' to 'type2', possible loss of data #define OBSOLETE __declspec(deprecated) -- cgit v1.2.3