diff options
author | Simon McVittie <smcv@collabora.com> | 2017-11-05 13:02:02 +0000 |
---|---|---|
committer | Simon McVittie <smcv@collabora.com> | 2017-11-05 13:02:02 +0000 |
commit | bde52a1943907dd87662c1eed1c27414670d7d17 (patch) | |
tree | 83f77536c01ede4fcd71ddc47d19cefbd16e43fd | |
parent | 258f328cdf919e02d895719ae04a5867f2782a67 (diff) |
build: Build with -Wno-duplicated-branches if the compiler supports it
Otherwise building with gcc 7 fails like this:
_dbus_bindings/server.c: In function ‘DBusPyServer_set_auth_mechanisms’:
/usr/include/python2.7/abstract.h:1161:43: error: this condition has identical branches [-Werror=duplicated-branches]
(PyList_Check(o) ? PyList_GET_SIZE(o) : PyTuple_GET_SIZE(o))
^
_dbus_bindings/server.c:101:14: note: in expansion of macro ‘PySequence_Fast_GET_SIZE’
length = PySequence_Fast_GET_SIZE(fast_seq);
^~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Simon McVittie <smcv@collabora.com>
-rw-r--r-- | configure.ac | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 97a05f5..55a7f91 100644 --- a/configure.ac +++ b/configure.ac @@ -196,6 +196,7 @@ AX_COMPILER_FLAGS([WARN_CFLAGS], dnl AX_COMPILER_FLAGS, and are not const-correct for strings [ \ -Wdeprecated-declarations \ + -Wno-duplicated-branches \ -Wno-redundant-decls \ -Wno-switch-default \ -Wno-write-strings \ @@ -204,6 +205,7 @@ AX_COMPILER_FLAGS([WARN_CFLAGS], dnl AX_COMPILER_FLAGS doesn't order the compiler flags correctly to be able dnl to disable flags that it would normally enable WARN_CFLAGS="$(echo "${WARN_CFLAGS}" | ${SED} \ + -e s/-Wduplicated-branches// \ -e s/-Wredundant-decls// \ -e s/-Wswitch-default// \ -e s/-Wwrite-strings// \ |