summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2013-09-05 19:36:03 +0300
committerTor Lillqvist <tml@collabora.com>2013-09-06 01:24:32 +0300
commit2d8a60e517c35276051a82b569515b49896b5be9 (patch)
treeffe64b2a2fb9cb37f2511816cd5e1581145b8b52
parent4159310a06d57efed75f8fa619c813c0222c4c58 (diff)
Disable C4702 when doing link-time code generation
Change-Id: I7d93c9cbb9a857384629b327c0f82b2e6d530bae
-rw-r--r--solenv/gbuild/platform/com_MSC_defs.mk22
1 files changed, 22 insertions, 0 deletions
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 <cppuhelper/implbase2.hxx>
+# 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.