From 87b8e9db16cf123438c0491caaaa641e6f20b018 Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Tue, 30 Oct 2012 22:32:32 +0200 Subject: [PATCH] [PATCH v6 1/9] build: drop the -Wswitch-enum warning --- f3/fdac6f9dcfb6569c6218e7da05456656658bd9 | 103 ++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 f3/fdac6f9dcfb6569c6218e7da05456656658bd9 diff --git a/f3/fdac6f9dcfb6569c6218e7da05456656658bd9 b/f3/fdac6f9dcfb6569c6218e7da05456656658bd9 new file mode 100644 index 000000000..aac2bad9b --- /dev/null +++ b/f3/fdac6f9dcfb6569c6218e7da05456656658bd9 @@ -0,0 +1,103 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id C954B431FAF + for ; Tue, 30 Oct 2012 13:32:51 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id uLNuXfaumIJE for ; + Tue, 30 Oct 2012 13:32:50 -0700 (PDT) +Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com + [209.85.217.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 82144431FBC + for ; Tue, 30 Oct 2012 13:32:50 -0700 (PDT) +Received: by mail-lb0-f181.google.com with SMTP id gg6so567600lbb.26 + for ; Tue, 30 Oct 2012 13:32:48 -0700 (PDT) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=google.com; s=20120113; + h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references + :in-reply-to:references:x-gm-message-state; + bh=tEgkORsN6sa99RYCBt1Lp/PPE0y1MSAl54933DOgTAA=; + b=TkNiySKCLBhWI0gIaWFHy4ziBWrH2JtR/DTcIm2JTLhEBS3WAE7Cbay0GEIP3ThT8D + Wf9vQxPoTJWmqPFbMoXPYbKymHO6eowJ6T761VEv/AklIGru6YlRe2oqUTohZAbmijPo + 40s+a7GjIz4mUsyrzTfwwfnzwqULsW0V72wEpBG+3veFx8YqCbgGoDB98ct1glQq0F1/ + JbKGOFWuaW3Y3GwxXPUW3ZEP+copObFwBebTmF1G1eUM1PI7ojJuxgjWVViNur91t8Mt + IvtwTRAI8WBZuIDIjvL3v0I44wrmxA4aCQWXzRa8Ipf3+WZooV3xDEXxmMva+w0PSnh7 + Tzmw== +Received: by 10.152.114.100 with SMTP id jf4mr31912848lab.47.1351629168711; + Tue, 30 Oct 2012 13:32:48 -0700 (PDT) +Received: from localhost (dsl-hkibrasgw4-fe51df00-27.dhcp.inet.fi. + [80.223.81.27]) + by mx.google.com with ESMTPS id oj5sm664466lab.8.2012.10.30.13.32.46 + (version=SSLv3 cipher=OTHER); Tue, 30 Oct 2012 13:32:47 -0700 (PDT) +From: Jani Nikula +To: notmuch@notmuchmail.org +Subject: [PATCH v6 1/9] build: drop the -Wswitch-enum warning +Date: Tue, 30 Oct 2012 22:32:32 +0200 +Message-Id: + <08cca3efe21ddf653996ff3d7a83fed0ca408f5d.1351626272.git.jani@nikula.org> +X-Mailer: git-send-email 1.7.10.4 +In-Reply-To: +References: +In-Reply-To: +References: +X-Gm-Message-State: + ALoCoQn6YUZrDnWxSH8EisTnl/WWXYdm6gUphidlKQ7LSLOHJyYhzxIUB+cU2fYddfsGya6SU+It +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Tue, 30 Oct 2012 20:32:52 -0000 + +-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. + +--- + +This will be useful in the next patch. +--- + configure | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure b/configure +index 232d847..ea8a1ad 100755 +--- 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}" +-- +1.7.10.4 + -- 2.26.2