From afa3ed9eafd50de4fa07b37acd4a317d515bf09d Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Sun, 2 Dec 2012 09:25:56 +0200 Subject: [PATCH] Disable MSVC warning C4986 This is a new warning in Visual Studio 2012. Otherwise, when using /Wall (as we do), you get tons of warnings from the compiler's own headers: .../crtdbg.h(1041) : warning C4986: 'operator new[]': exception specification does not match previous declaration .../new(79) : see declaration of 'operator new[]' It seems to be generally recommended not to use /Wall with MSVC (that option does not really have the same intended use as gcc's -Wall, people say), but use /W4 instead: http://stackoverflow.com/a/4001759/259398 So maybe we should change that -Wall to -W4? Also, we should go over the long list of -wd options and check each whether we really want it or not. Maybe, while at it, add a comment for each giving its one-line meaning. --- solenv/gbuild/platform/com_MSC_defs.mk | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/solenv/gbuild/platform/com_MSC_defs.mk b/solenv/gbuild/platform/com_MSC_defs.mk index aca825cba84e..5017283a2566 100644 --- a/solenv/gbuild/platform/com_MSC_defs.mk +++ b/solenv/gbuild/platform/com_MSC_defs.mk @@ -184,6 +184,20 @@ gb_CXXFLAGS := \ -Zc:forScope,wchar_t- \ -Zm500 \ +# New warning(s) in Visual Studio 2012, let's try disabling these only +# for that specific compiler version, in case a later one will not +# need them disabled. +ifeq ($(VCVER),110) + +# C4986: 'function': exception specification does not match previous +# declaration. This warning is generated by VS2012 headers (!), and is +# C++-only. + +gb_CXXFLAGS += \ + -wd4986 \ + +endif + gb_STDLIBS := \ advapi32.lib \