From 9109c3a8d4c7d0b929806180cfb7e263b8b352c9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Tue, 24 May 2011 19:31:26 +0100 Subject: [PATCH] Silence MSVC warnings. --- CMakeLists.txt | 1 + retrace.py | 3 +++ zlib/CMakeLists.txt | 7 ++++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3552890..0319ddf 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,6 +59,7 @@ 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) + 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 (-wd4800) # forcing value to bool 'true' or 'false' (performance warning) diff --git a/retrace.py b/retrace.py index a9c5b4d..3b68d60 100644 --- a/retrace.py +++ b/retrace.py @@ -190,6 +190,7 @@ class Retracer: def retrace_function_body(self, function): if not function.sideeffects: + print ' (void)call;' return success = True @@ -205,7 +206,9 @@ class Retracer: success = False print ' %s = 0; // FIXME' % arg.name if not success: + print ' if (1) {' self.fail_function(function) + print ' }' self.call_function(function) for arg in function.args: if arg.output: diff --git a/zlib/CMakeLists.txt b/zlib/CMakeLists.txt index a1f3511..514c953 100644 --- a/zlib/CMakeLists.txt +++ b/zlib/CMakeLists.txt @@ -23,8 +23,13 @@ check_include_file(unistd.h Z_HAVE_UNISTD_H) add_definitions(-DNO_VIZ) +if (MSVC) + add_definitions (-wd4127) # conditional expression is constant + add_definitions (-wd4131) # uses old-style declaratorion +endif (MSVC) + if (NOT WIN32) - add_definitions(-fPIC) + add_definitions (-fPIC) endif (NOT WIN32) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -- 2.7.4