From d76bcf98a385524579e7ed87b3e3ee89704b5fd6 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 19 Feb 2014 17:37:02 +1100 Subject: MSVC: improve warnings for scons and cmake Some int/float conversion warnings were disabled by buildsystems but re-enabled by BLI_winstuff.h, the warnigns relate to conversions not considered issues on other systems so better just quiet them. --- CMakeLists.txt | 1 + build_files/scons/config/win32-vc-config.py | 2 +- build_files/scons/config/win64-vc-config.py | 3 ++- source/blender/blenkernel/BKE_pbvh.h | 4 ---- source/blender/blenlib/BLI_winstuff.h | 4 +--- source/blender/blenlib/intern/freetypefont.c | 5 ----- source/blender/blenlib/intern/noise.c | 6 ------ 7 files changed, 5 insertions(+), 20 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f096461aa7..d0210e1ecce 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1007,6 +1007,7 @@ elseif(WIN32) # disable: "/wd4018" # signed/unsigned mismatch "/wd4065" # switch statement contains 'default' but no 'case' labels + "/wd4127" # conditional expression is constant "/wd4181" # qualifier applied to reference type; ignored "/wd4200" # zero-sized array in struct/union "/wd4244" # conversion from 'type1' to 'type2', possible loss of data diff --git a/build_files/scons/config/win32-vc-config.py b/build_files/scons/config/win32-vc-config.py index 86360c0728f..b4412bc3faf 100644 --- a/build_files/scons/config/win32-vc-config.py +++ b/build_files/scons/config/win32-vc-config.py @@ -246,7 +246,7 @@ BF_OPENGL_LIB_STATIC = [ '${BF_OPENGL}/lib/libGL.a', '${BF_OPENGL}/lib/libGLU.a' CC = 'cl.exe' CXX = 'cl.exe' -CCFLAGS = ['/nologo', '/J', '/W1', '/Gd', '/wd4018', '/wd4244', '/wd4305', '/wd4800', '/wd4065', '/wd4267', '/we4013'] +CCFLAGS = ['/nologo', '/J', '/W1', '/Gd', '/wd4018', '/wd4065', '/wd4127', '/wd4181', '/wd4200', '/wd4244', '/wd4267', '/wd4305', '/wd4800', '/we4013'] CXXFLAGS = ['/EHsc'] BGE_CXXFLAGS = ['/O2', '/Ob2', '/EHsc', '/GR', '/fp:fast', '/arch:SSE'] diff --git a/build_files/scons/config/win64-vc-config.py b/build_files/scons/config/win64-vc-config.py index 10994d3843c..ea9a7934518 100644 --- a/build_files/scons/config/win64-vc-config.py +++ b/build_files/scons/config/win64-vc-config.py @@ -245,7 +245,8 @@ CC = 'cl.exe' CXX = 'cl.exe' CFLAGS = [] -CCFLAGS = ['/nologo', '/J', '/W1', '/Gd', '/we4013', '/wd4018', '/wd4244', '/wd4305', '/wd4800', '/wd4065', '/wd4267'] +CCFLAGS = ['/nologo', '/J', '/W1', '/Gd', '/wd4018', '/wd4065', '/wd4127', '/wd4181', '/wd4200', '/wd4244', '/wd4267', '/wd4305', '/wd4800', '/we4013'] + CXXFLAGS = ['/EHsc'] BGE_CXXFLAGS = ['/O2', '/Ob2', '/EHsc', '/GR', '/fp:fast'] diff --git a/source/blender/blenkernel/BKE_pbvh.h b/source/blender/blenkernel/BKE_pbvh.h index 1a2d6469a29..34e96599b7e 100644 --- a/source/blender/blenkernel/BKE_pbvh.h +++ b/source/blender/blenkernel/BKE_pbvh.h @@ -256,10 +256,6 @@ typedef struct PBVHVertexIter { float *mask; } PBVHVertexIter; -#ifdef _MSC_VER -#pragma warning (disable:4127) // conditional expression is constant -#endif - void pbvh_vertex_iter_init(PBVH *bvh, PBVHNode *node, PBVHVertexIter *vi, int mode); diff --git a/source/blender/blenlib/BLI_winstuff.h b/source/blender/blenlib/BLI_winstuff.h index 1959d5171fb..f615e5a9300 100644 --- a/source/blender/blenlib/BLI_winstuff.h +++ b/source/blender/blenlib/BLI_winstuff.h @@ -37,9 +37,7 @@ # error "This include is for Windows only!" #endif -#ifndef FREE_WINDOWS -# pragma warning(once: 4761 4305 4244 4018) -#else +#ifdef FREE_WINDOWS # ifdef WINVER # undef WINVER # endif diff --git a/source/blender/blenlib/intern/freetypefont.c b/source/blender/blenlib/intern/freetypefont.c index 43cf6c665c2..4680cfc1add 100644 --- a/source/blender/blenlib/intern/freetypefont.c +++ b/source/blender/blenlib/intern/freetypefont.c @@ -32,11 +32,6 @@ * \ingroup bli */ - -#ifdef _MSC_VER -# pragma warning (disable:4244) -#endif - #include #include FT_FREETYPE_H /* not needed yet */ diff --git a/source/blender/blenlib/intern/noise.c b/source/blender/blenlib/intern/noise.c index 5b9fefe77bb..982a74b1ffd 100644 --- a/source/blender/blenlib/intern/noise.c +++ b/source/blender/blenlib/intern/noise.c @@ -30,12 +30,6 @@ * \ingroup bli */ - -#ifdef _MSC_VER -# pragma warning (disable:4244) /* "conversion from double to float" */ -# pragma warning (disable:4305) /* "truncation from const double to float" */ -#endif - #include #include "BLI_noise.h" -- cgit v1.2.3