diff --git a/solenv/gbuild/platform/com_MSC_defs.mk b/solenv/gbuild/platform/com_MSC_defs.mk index aaf1a554f9d8..93ab5187d8c1 100644 --- a/solenv/gbuild/platform/com_MSC_defs.mk +++ b/solenv/gbuild/platform/com_MSC_defs.mk @@ -117,6 +117,8 @@ gb_AFLAGS := $(AFLAGS) # C4626: 'derived class' : assignment operator could not be generated # because a base class assignment operator is inaccessible +# C4702: unreachable code + # C4706: assignment within conditional expression # C4800: 'type' : forcing value to bool 'true' or 'false' (performance @@ -187,6 +189,26 @@ gb_CXXFLAGS += \ endif +ifneq ($(ENABLE_LTO),) + +# Sigh, but there are cases of C4702 when using link-time code +# generation and optimisation where I couldn't get +# __pragma(warning(disable:4702)) to help. Especially, the +# ImplInheritanceHelper2() {} in +# was reported as containing "unreachable code" when linking +# the dbaccess dbu library. Let's try globally disabling C4702. + +# Might be fixed in VS2013 though? +# VCVER=100 for VS2010 and VCVER=110 for VS2012 + +ifneq ($(filter 100 110,$(VCVER)),) +gb_CXXFLAGS += \ + -wd4702 \ + +endif + +endif + # New warning(s) in Visual Studio 2010, let's try disabling these only # for that specific compiler version, in case a later one will not # need them disabled.