From f9e8300b22e914dafb336a1a7beb579a0155d23a Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Mon, 23 Feb 2015 18:56:16 +0200 Subject: [PATCH] [PATCH 3/3] cli: fix clang build warnings --- 03/99aa8b3a9e53b7317a19ccd27aef2f354ae8e2 | 109 ++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 03/99aa8b3a9e53b7317a19ccd27aef2f354ae8e2 diff --git a/03/99aa8b3a9e53b7317a19ccd27aef2f354ae8e2 b/03/99aa8b3a9e53b7317a19ccd27aef2f354ae8e2 new file mode 100644 index 000000000..9da6a8a66 --- /dev/null +++ b/03/99aa8b3a9e53b7317a19ccd27aef2f354ae8e2 @@ -0,0 +1,109 @@ +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 09618431E62 + for ; Mon, 23 Feb 2015 09:04:26 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 1.738 +X-Spam-Level: * +X-Spam-Status: No, score=1.738 tagged_above=-999 required=5 + tests=[DNS_FROM_AHBL_RHSBL=2.438, 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 ZHfCUGRtcqcG for ; + Mon, 23 Feb 2015 09:04:24 -0800 (PST) +Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com + [209.85.212.174]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 60C02431FD9 + for ; Mon, 23 Feb 2015 09:04:21 -0800 (PST) +Received: by mail-wi0-f174.google.com with SMTP id em10so19270315wid.1 + for ; Mon, 23 Feb 2015 08:56:04 -0800 (PST) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20130820; + h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to + :references; + bh=Z50C3M6oDYX1vbDKJxO5Sy4mPH9dAbDYP+hM1nR7USw=; + b=BtaAf3Af49W1i1aC5qe5w7jMoSD7oA9ZuY2NynD6o7AIvYErPD2oXcceaZIwMZGirw + SHNWo/7cwelM1vKfWIhryxPe/J+pkLz8EC4bK6X4B0y6Iq1PscEqJSIYGd+vqbOSVZyQ + qQh6IjXK6mjLBJc7B4nxTS95dWtQWkBKglmFkBpRuYuCTyf4ypSZZS65owEW9Lr2jj1c + 5yjdpsaWf3qKvQimaxOOI/9p3or23Gr/FizhV3Ua32irtVeyQMkyI17g43ZwLh8DSpMt + 89cvLnYTztc26qHICA57hYhboQ9qphxT8WR47De0px+1buU7GHKUp3hnbc083iCrJWMW + HJbg== +X-Gm-Message-State: + ALoCoQlmRUTrjo1ReHWAuxHSRGkArrofJOsXL9i137xqBppcTkgpanSphI+HbjBSj4vR/7D+UXye +X-Received: by 10.181.8.225 with SMTP id dn1mr22893838wid.55.1424710563878; + Mon, 23 Feb 2015 08:56:03 -0800 (PST) +Received: from localhost (mobile-internet-bcee3b-76.dhcp.inet.fi. + [188.238.59.76]) by mx.google.com with ESMTPSA id + e18sm56355079wjz.27.2015.02.23.08.56.02 + (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); + Mon, 23 Feb 2015 08:56:03 -0800 (PST) +From: Jani Nikula +To: notmuch@notmuchmail.org +Subject: [PATCH 3/3] cli: fix clang build warnings +Date: Mon, 23 Feb 2015 18:56:16 +0200 +Message-Id: <1424710576-30468-3-git-send-email-jani@nikula.org> +X-Mailer: git-send-email 2.1.4 +In-Reply-To: <1424710576-30468-1-git-send-email-jani@nikula.org> +References: <1424710576-30468-1-git-send-email-jani@nikula.org> +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: Mon, 23 Feb 2015 17:04:26 -0000 + +Fix the following warning produced by clang 3.5.0: + +notmuch-search.c:730:25: warning: initializing 'void *' with an +expression of type 'const notmuch_opt_desc_t (*)[4]' discards +qualifiers [-Wincompatible-pointer-types-discards-qualifiers] + { NOTMUCH_OPT_INHERIT, &common_options, NULL, 0, 0 }, + ^~~~~~~~~~~~~~~ +1 warning generated. + +--- + +I'm not really happy with this one. An alternative would be to drop +const from common_options, but I'm not happy with that either. And I'm +not happy with the warning. :( +--- + notmuch-search.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/notmuch-search.c b/notmuch-search.c +index 14b9f01c5ad1..a591d45b4c39 100644 +--- a/notmuch-search.c ++++ b/notmuch-search.c +@@ -671,7 +671,7 @@ notmuch_search_command (notmuch_config_t *config, int argc, char *argv[]) + { NOTMUCH_OPT_INT, &ctx->offset, "offset", 'O', 0 }, + { NOTMUCH_OPT_INT, &ctx->limit, "limit", 'L', 0 }, + { NOTMUCH_OPT_INT, &ctx->dupe, "duplicate", 'D', 0 }, +- { NOTMUCH_OPT_INHERIT, &common_options, NULL, 0, 0 }, ++ { NOTMUCH_OPT_INHERIT, (void *) &common_options, NULL, 0, 0 }, + { 0, 0, 0, 0, 0 } + }; + +@@ -727,7 +727,7 @@ notmuch_address_command (notmuch_config_t *config, int argc, char *argv[]) + (notmuch_keyword_t []){ { "true", NOTMUCH_EXCLUDE_TRUE }, + { "false", NOTMUCH_EXCLUDE_FALSE }, + { 0, 0 } } }, +- { NOTMUCH_OPT_INHERIT, &common_options, NULL, 0, 0 }, ++ { NOTMUCH_OPT_INHERIT, (void *) &common_options, NULL, 0, 0 }, + { 0, 0, 0, 0, 0 } + }; + +-- +2.1.4 + -- 2.26.2