From 5888860d2aae70914ec150bfdb82c8d7e0149ebb Mon Sep 17 00:00:00 2001 From: Vicent Marti Date: Wed, 28 Sep 2011 23:42:38 +0200 Subject: [PATCH] msvc: Disable warnings in header file Remove clutter from the CMakeLists file by disabling the warnings programatically. --- CMakeLists.txt | 2 +- src/win32/msvc-compat.h | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8ef35877e..a65ba3a2c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,7 +53,7 @@ OPTION (BUILD_CLAY "Build Tests using the Clay suite" ON) # Platform specific compilation flags IF (MSVC) - SET(CMAKE_C_FLAGS "/W4 /WX /nologo /Zi /wd4127") + SET(CMAKE_C_FLAGS "/W4 /nologo /Zi") IF (STDCALL) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Gz") ENDIF () diff --git a/src/win32/msvc-compat.h b/src/win32/msvc-compat.h index 64ed18476..2211de53a 100644 --- a/src/win32/msvc-compat.h +++ b/src/win32/msvc-compat.h @@ -9,6 +9,16 @@ #if defined(_MSC_VER) +/* + * Disable silly MSVC warnings + */ + +/* conditional expression is constant */ +#pragma warning(disable: 4127) + +/* nonstandard extension used : bit field types other than int */ +#pragma warning(disable: 4214) + /* access() mode parameter #defines */ # define F_OK 0 /* existence check */ # define W_OK 2 /* write mode check */