]> git.notmuchmail.org Git - notmuch/commitdiff
build: drop the -Wswitch-enum warning
authorJani Nikula <jani@nikula.org>
Tue, 30 Oct 2012 20:32:32 +0000 (22:32 +0200)
committerDavid Bremner <bremner@debian.org>
Wed, 31 Oct 2012 19:39:25 +0000 (16:39 -0300)
-Wswitch-enum is a bit awkward if a switch statement is intended to
handle just some of the named codes of an enumeration especially, and
leave the rest to the default label.

We already have -Wall, which enables -Wswitch by default, and per GCC
documentation, "The only difference between -Wswitch and this option
[-Wswitch-enum] is that this option gives a warning about an omitted
enumeration code even if there is a default label."

Drop -Wswitch-enum to not force listing all named codes of
enumerations in switch statements that have a default label.

configure

index 232d8477145626dfefc24137147dc5002a836cf2..ea8a1ad5d996cecff184d449318c46ea9a01feea 100755 (executable)
--- a/configure
+++ b/configure
@@ -536,7 +536,7 @@ fi
 
 WARN_CXXFLAGS=""
 printf "Checking for available C++ compiler warning flags... "
-for flag in -Wall -Wextra -Wwrite-strings -Wswitch-enum; do
+for flag in -Wall -Wextra -Wwrite-strings; do
     if ${CC} $flag -o minimal minimal.c > /dev/null 2>&1
     then
        WARN_CXXFLAGS="${WARN_CXXFLAGS}${WARN_CXXFLAGS:+ }${flag}"