Add -Wduplicated-branches to extra warnings
authorAlexis La Goutte <alexis.lagoutte@gmail.com>
Mon, 6 Mar 2017 20:22:39 +0000 (21:22 +0100)
committerMichael Mann <mmann78@netscape.net>
Wed, 12 Apr 2017 11:28:16 +0000 (11:28 +0000)
Change-Id: I11d60b4405f4fde039affcdeebb13a3ceb2aded6
Reviewed-on: https://code.wireshark.org/review/20428
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
CMakeLists.txt
configure.ac

index 992b0cf57270b1513369c88de181adee25f5f4da..bafcd59750b460f0a5c878e4e5f213289679ea74 100644 (file)
@@ -494,6 +494,10 @@ else()
                # No longer supported by El Capitan clang on C++
                #
                -fno-delete-null-pointer-checks
+
+               # Works only with GCC 7
+               -Wduplicated-branches
+
        )
 
        set(C_EXTRA_WARN_FLAGS
index 166c507bbd1ccd03204c57aac0c417adfc8ba412..5d8673530e83115f684498f913d0dab78fea6261 100644 (file)
@@ -748,6 +748,10 @@ AC_ARG_ENABLE(extra-compiler-warnings,
                # never enable this one with -Werror.
                #
                AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wbad-function-cast, C)
+
+               # Works only with GCC 7
+               AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wduplicated-branches)
+
        fi
 ])