1 Return-Path: <jani@nikula.org>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id A8EB3431FBC
\r
6 for <notmuch@notmuchmail.org>; Mon, 1 Oct 2012 00:36:16 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id 1RCVd2g-pxAM for <notmuch@notmuchmail.org>;
\r
16 Mon, 1 Oct 2012 00:36:16 -0700 (PDT)
\r
17 Received: from mail-qa0-f53.google.com (mail-qa0-f53.google.com
\r
18 [209.85.216.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
19 (No client certificate requested)
\r
20 by olra.theworths.org (Postfix) with ESMTPS id DC612431FAE
\r
21 for <notmuch@notmuchmail.org>; Mon, 1 Oct 2012 00:36:15 -0700 (PDT)
\r
22 Received: by qaas11 with SMTP id s11so1589880qaa.5
\r
23 for <notmuch@notmuchmail.org>; Mon, 01 Oct 2012 00:36:15 -0700 (PDT)
\r
24 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
25 d=google.com; s=20120113;
\r
26 h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state;
\r
27 bh=e2Oax5anIKqwX844uyRG7rUlMOlHDvAfJySib1U/XB8=;
\r
28 b=DByZuJM6XBJFa2yIgRR2EPaL4Q4T7DOznu9aOpbA2IfIzqkBU8SwcLIFTnOiRtD/87
\r
29 G50K918vnmEQTw0MNdF1eHxJvfrlfCSe+Dg90Yu05LfvXUF6qO5zr3uTiFhPwemqR+zh
\r
30 IdF6A8t7LsKLvxTAqU7Kvnj8nJnrLxP4YGDVGir1o7oYu2I9IDxluwpJORQ0N1yAjNVD
\r
31 axZeogjOh7bc+c8CDHN696dJ/W5Sn+zwuifukZHjXKdKvBFHlfGAC0HeTEPdPxsqRbfU
\r
32 ejdWFpU0yRFsH5Vva7n38WH9nU3/kOI41QTC6+/oBsfo9MyYXQNVcvjE8se0wWfcqQKZ
\r
34 Received: by 10.224.190.2 with SMTP id dg2mr34809229qab.51.1349076975231;
\r
35 Mon, 01 Oct 2012 00:36:15 -0700 (PDT)
\r
36 Received: from localhost ([2001:4b98:dc0:43:216:3eff:fe1b:25f3])
\r
37 by mx.google.com with ESMTPS id gw9sm23604976qab.4.2012.10.01.00.36.13
\r
38 (version=SSLv3 cipher=OTHER); Mon, 01 Oct 2012 00:36:14 -0700 (PDT)
\r
39 From: Jani Nikula <jani@nikula.org>
\r
40 To: notmuch@notmuchmail.org
\r
41 Subject: [PATCH] lib: fix warnings when building with clang
\r
42 Date: Mon, 1 Oct 2012 09:36:11 +0200
\r
43 Message-Id: <1349076971-2065-1-git-send-email-jani@nikula.org>
\r
44 X-Mailer: git-send-email 1.7.2.5
\r
46 ALoCoQkIOQVwDNsV//sUH0Q1vTFMIx4v8h+1WQXEVMZFK417Z6noAdg1Ya3SYlaid4SZsqlQIsbY
\r
47 X-BeenThere: notmuch@notmuchmail.org
\r
48 X-Mailman-Version: 2.1.13
\r
50 List-Id: "Use and development of the notmuch mail system."
\r
51 <notmuch.notmuchmail.org>
\r
52 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
53 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
54 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
55 List-Post: <mailto:notmuch@notmuchmail.org>
\r
56 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
57 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
58 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
59 X-List-Received-Date: Mon, 01 Oct 2012 07:36:16 -0000
\r
61 Building notmuch with CC=clang and CXX=clang++ produces the warnings:
\r
64 lib/tags.c:43:5: warning: expression result unused [-Wunused-value]
\r
65 talloc_steal (tags, list);
\r
66 ^~~~~~~~~~~~~~~~~~~~~~~~~
\r
67 /usr/include/talloc.h:345:143: note: expanded from:
\r
68 ...__location__); __talloc_steal_ret; })
\r
70 1 warning generated.
\r
72 CXX -O2 lib/message.o
\r
73 lib/message.cc:791:5: warning: expression result unused [-Wunused-value]
\r
74 talloc_reference (message, message->tag_list);
\r
75 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\r
76 /usr/include/talloc.h:932:36: note: expanded from:
\r
77 ...(_TALLOC_TYPEOF(ptr))_talloc_reference_loc((ctx),(ptr), __location__)
\r
78 ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\r
79 1 warning generated.
\r
81 Check talloc_reference() return value, and explicitly ignore
\r
82 talloc_steal() return value as it has no failure modes, to silence the
\r
85 lib/message.cc | 4 +++-
\r
87 2 files changed, 4 insertions(+), 2 deletions(-)
\r
89 diff --git a/lib/message.cc b/lib/message.cc
\r
90 index 978de06..320901f 100644
\r
91 --- a/lib/message.cc
\r
92 +++ b/lib/message.cc
\r
93 @@ -788,7 +788,9 @@ notmuch_message_get_tags (notmuch_message_t *message)
\r
94 * possible to modify the message tags (which talloc_unlink's the
\r
95 * current list from the message) while still iterating because
\r
96 * the iterator will keep the current list alive. */
\r
97 - talloc_reference (message, message->tag_list);
\r
98 + if (!talloc_reference (message, message->tag_list))
\r
104 diff --git a/lib/tags.c b/lib/tags.c
\r
105 index c58924f..b7e5602 100644
\r
108 @@ -40,7 +40,7 @@ _notmuch_tags_create (const void *ctx, notmuch_string_list_t *list)
\r
111 tags->iterator = list->head;
\r
112 - talloc_steal (tags, list);
\r
113 + (void) talloc_steal (tags, list);
\r