[PATCH 1/2] fix compilation without emacs
[notmuch-archives.git] / cc / ccaa5723fc7bac009e9748e4de66226858f8cc
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 BE81F407696\r
6         for <notmuch@notmuchmail.org>; Sat,  7 Jan 2012 15:26:43 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
9 X-Spam-Flag: NO\r
10 X-Spam-Score: -0.7\r
11 X-Spam-Level: \r
12 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
13         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id LmtA3iUQ1m5z for <notmuch@notmuchmail.org>;\r
17         Sat,  7 Jan 2012 15:26:42 -0800 (PST)\r
18 Received: from mail-ee0-f53.google.com (mail-ee0-f53.google.com\r
19  [74.125.83.53])        (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
20  certificate requested) by olra.theworths.org (Postfix) with ESMTPS id\r
21  7611D40EEF9    for <notmuch@notmuchmail.org>; Sat,  7 Jan 2012 15:26:40 -0800\r
22  (PST)\r
23 Received: by mail-ee0-f53.google.com with SMTP id d41so2133471eek.26\r
24         for <notmuch@notmuchmail.org>; Sat, 07 Jan 2012 15:26:40 -0800 (PST)\r
25 Received: by 10.14.127.197 with SMTP id d45mr4259255eei.91.1325978800065;\r
26         Sat, 07 Jan 2012 15:26:40 -0800 (PST)\r
27 Received: from localhost (dsl-hkibrasgw4-fe5cdc00-23.dhcp.inet.fi.\r
28         [80.220.92.23]) by mx.google.com with ESMTPS id\r
29         y12sm267561571eeb.11.2012.01.07.15.26.38\r
30         (version=SSLv3 cipher=OTHER); Sat, 07 Jan 2012 15:26:39 -0800 (PST)\r
31 From: Jani Nikula <jani@nikula.org>\r
32 To: notmuch@notmuchmail.org\r
33 Subject: [RFC PATCH 4/9] lib: HACK: avoid warnings from talloc_steal()\r
34 Date: Sun,  8 Jan 2012 01:26:18 +0200\r
35 Message-Id:\r
36  <4f8dac27c84d35c51f692f2589cacb2a06da554b.1325977940.git.jani@nikula.org>\r
37 X-Mailer: git-send-email 1.7.5.4\r
38 In-Reply-To: <cover.1325977940.git.jani@nikula.org>\r
39 References: <cover.1325977940.git.jani@nikula.org>\r
40 In-Reply-To: <cover.1325977940.git.jani@nikula.org>\r
41 References: <cover.1325977940.git.jani@nikula.org>\r
42 MIME-Version: 1.0\r
43 Content-Type: text/plain; charset=UTF-8\r
44 Content-Transfer-Encoding: 8bit\r
45 X-BeenThere: notmuch@notmuchmail.org\r
46 X-Mailman-Version: 2.1.13\r
47 Precedence: list\r
48 List-Id: "Use and development of the notmuch mail system."\r
49         <notmuch.notmuchmail.org>\r
50 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
51         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
52 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
53 List-Post: <mailto:notmuch@notmuchmail.org>\r
54 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
55 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
56         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
57 X-List-Received-Date: Sat, 07 Jan 2012 23:26:44 -0000\r
58 \r
59 talloc.h #defines talloc_steal() with macros to make it type safe, but\r
60 introduces a warning when compiled using -std=c99 -pedantic:\r
61 \r
62 lib/tags.c: In function ‘_notmuch_tags_create’:\r
63 lib/tags.c:43:5: warning: ISO C forbids braced-groups within expressions [-pedantic]\r
64 \r
65 Call _talloc_steal_loc() directly without the macro wrapper. We aren't even\r
66 interested in the return value the macro is so hard trying to provide type\r
67 safety for.\r
68 \r
69 Signed-off-by: Jani Nikula <jani@nikula.org>\r
70 ---\r
71  lib/tags.c |    5 ++++-\r
72  1 files changed, 4 insertions(+), 1 deletions(-)\r
73 \r
74 diff --git a/lib/tags.c b/lib/tags.c\r
75 index c58924f..56c43e2 100644\r
76 --- a/lib/tags.c\r
77 +++ b/lib/tags.c\r
78 @@ -40,7 +40,10 @@ _notmuch_tags_create (const void *ctx, notmuch_string_list_t *list)\r
79         return NULL;\r
80  \r
81      tags->iterator = list->head;\r
82 -    talloc_steal (tags, list);\r
83 +\r
84 +    /* _talloc_steal_loc() is talloc_steal() without macro wrapping to avoid\r
85 +     * -std=c99 -pedantic warning. __location__ is defined in talloc.h. */\r
86 +    _talloc_steal_loc (tags, list, __location__);\r
87  \r
88      return tags;\r
89  }\r
90 -- \r
91 1.7.5.4\r
92 \r