summaryrefslogtreecommitdiff
path: root/solenv
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-01-23 16:23:20 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-01-24 07:54:25 +0100
commitce99754e9b5b954be4360f39356ed7198b298265 (patch)
tree58097ac2792ad389ed6ba33f88a50b09352291f2 /solenv
parentfa1caba2a82cc31f3d9c1c18e00325766aa1c90c (diff)
Globally disable -Wcast-function-type new with upcoming GCC 8
...which unhelpfully even warns on reinterpret_cast, so causes failures like > [CXX] sal/osl/unx/signal.cxx > sal/osl/unx/signal.cxx: In function ‘bool onInitSignal()’: > sal/osl/unx/signal.cxx:267:50: error: cast between incompatible function types from ‘void (*)(int, siginfo_t*, void*)’ to ‘{anonymous}::Handler1’ {aka ‘void (*)(int)’} [-Werror=cast-function-type] > oact.sa_sigaction); > ^ And since all incompatible (but deliberate) casts between function types across our code base should already be written as reinterpret_cast, we shouldn't lose much by just disabling this new warning globally. Change-Id: If15e9606e8fdc676b61012e31d7369653951ceca Reviewed-on: https://gerrit.libreoffice.org/48431 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'solenv')
-rw-r--r--solenv/gbuild/platform/com_GCC_defs.mk7
1 files changed, 7 insertions, 0 deletions
diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk
index 68de52a41593..4dc10e5bfccc 100644
--- a/solenv/gbuild/platform/com_GCC_defs.mk
+++ b/solenv/gbuild/platform/com_GCC_defs.mk
@@ -96,6 +96,13 @@ gb_CXXFLAGS_COMMON += \
-Wunused-const-variable=1
endif
+# GCC 8 -Wcast-function-type (included in -Wextra) unhelpfully even warns on reinterpret_cast
+# between incompatible function types:
+ifeq ($(shell expr '$(GCC_VERSION)' '>=' 800),1)
+gb_CXXFLAGS_COMMON += \
+ -Wno-cast-function-type
+endif
+
ifeq ($(COM_IS_CLANG),TRUE)
gb_CXXFLAGS_COMMON += -Wimplicit-fallthrough
else