From: José Fonseca Date: Mon, 23 Apr 2012 11:19:53 +0000 (+0100) Subject: Tone down some MSVC warnings. X-Git-Url: https://git.cworth.org/git?p=apitrace;a=commitdiff_plain;h=af7fc5cf9847b5622dcb0901cce7199df80c101d Tone down some MSVC warnings. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index f817701..033d9fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -92,13 +92,15 @@ if (MSVC) add_definitions (-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS) add_definitions (-D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS) add_definitions (-W4) + # XXX: it's safer to use ssize_t everywhere instead of disabling warning + add_definitions (-wd4018) # signed/unsigned mismatch add_definitions (-wd4063) # not a valid value for switch of enum + add_definitions (-wd4100) # unreferenced formal parameter add_definitions (-wd4127) # conditional expression is constant add_definitions (-wd4244) # conversion from 'type1' to 'type2', possible loss of data add_definitions (-wd4505) # unreferenced local function has been removed + add_definitions (-wd4512) # assignment operator could not be generated add_definitions (-wd4800) # forcing value to bool 'true' or 'false' (performance warning) - # XXX: it's safer to use ssize_t everywhere instead of disabling warning - add_definitions (-wd4018) # signed/unsigned mismatch # Use static runtime # http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_build_my_MSVC_application_with_a_static_runtime.3F diff --git a/common/os_binary.hpp b/common/os_binary.hpp index 876bdb6..a231c70 100644 --- a/common/os_binary.hpp +++ b/common/os_binary.hpp @@ -49,6 +49,7 @@ void setBinaryMode(FILE *fp) { fflush(fp); int mode = _setmode(_fileno(fp), _O_BINARY); assert(mode != -1); + (void)mode; #else (void)fp; #endif