From 583a39f0b4eb5ad48f0127a0fe2a3726f7a91914 Mon Sep 17 00:00:00 2001 From: Tomi Ollila Date: Mon, 23 Feb 2015 21:11:32 +0200 Subject: [PATCH] Re: [PATCH 3/3] cli: fix clang build warnings --- d5/17ad773486ab966f776b0350f06af0f4bb7854 | 103 ++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 d5/17ad773486ab966f776b0350f06af0f4bb7854 diff --git a/d5/17ad773486ab966f776b0350f06af0f4bb7854 b/d5/17ad773486ab966f776b0350f06af0f4bb7854 new file mode 100644 index 000000000..7cc0111f8 --- /dev/null +++ b/d5/17ad773486ab966f776b0350f06af0f4bb7854 @@ -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 66108431FDF + for ; Mon, 23 Feb 2015 11:20:13 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 2.438 +X-Spam-Level: ** +X-Spam-Status: No, score=2.438 tagged_above=-999 required=5 + tests=[DNS_FROM_AHBL_RHSBL=2.438] 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 nRx30HIWUmD8 for ; + Mon, 23 Feb 2015 11:20:10 -0800 (PST) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by olra.theworths.org (Postfix) with ESMTP id 271CE431FDE + for ; Mon, 23 Feb 2015 11:20:10 -0800 (PST) +Received: from guru.guru-group.fi (localhost [IPv6:::1]) + by guru.guru-group.fi (Postfix) with ESMTP id F291410019F; + Mon, 23 Feb 2015 21:11:32 +0200 (EET) +From: Tomi Ollila +To: Jani Nikula , notmuch@notmuchmail.org +Subject: Re: [PATCH 3/3] cli: fix clang build warnings +In-Reply-To: <1424710576-30468-3-git-send-email-jani@nikula.org> +References: <1424710576-30468-1-git-send-email-jani@nikula.org> + <1424710576-30468-3-git-send-email-jani@nikula.org> +User-Agent: Notmuch/0.19+53~gb45d2f9 (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-unknown-linux-gnu) +X-Face: HhBM'cA~ +MIME-Version: 1.0 +Content-Type: text/plain +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 19:20:13 -0000 + +On Mon, Feb 23 2015, Jani Nikula wrote: + +> 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. :( + +This looks tolerable to be and the whole series good. tests pass. + +> --- +> 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 +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch -- 2.26.2