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 ECC5E429E59
\r
6 for <notmuch@notmuchmail.org>; Sun, 18 Aug 2013 11:58:00 -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 ToFk+A7toAv9 for <notmuch@notmuchmail.org>;
\r
16 Sun, 18 Aug 2013 11:57:55 -0700 (PDT)
\r
17 Received: from mail-bk0-f53.google.com (mail-bk0-f53.google.com
\r
18 [209.85.214.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 12169431FDB
\r
21 for <notmuch@notmuchmail.org>; Sun, 18 Aug 2013 11:57:54 -0700 (PDT)
\r
22 Received: by mail-bk0-f53.google.com with SMTP id d7so1205213bkh.12
\r
23 for <notmuch@notmuchmail.org>; Sun, 18 Aug 2013 11:57:53 -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=x-gm-message-state:from:to:cc:subject:in-reply-to:references
\r
27 :user-agent:date:message-id:mime-version:content-type;
\r
28 bh=O/tTDsO9B3j/dlFKE7Dhqe0FUvBArLs2gjWiXh8JYTA=;
\r
29 b=APpURbZIoXe9MJDnYNNk1p+mATSph2hQSNCgBNRa8Lgn1jHhM+CgKtf0bfMzJyxlUH
\r
30 L1RkjAX0DHH47amfPUfAV3JXHfeBV/UaGquDpvPoYQoxOhH9m/LlR00lIEWgOFtoCVCU
\r
31 b9D97Uuh5NVzL0HQBqLQ75D4fglIo1ZJrGS0xtP3CdyTRUgwQGyPkAU3GJSPQXzIf8nC
\r
32 OtF03MLW6F9bHQe9nuPOA2lHA9eZEJpRbfCsdBK7ifdtx+9jB4w0h17j4VLdQnKG63oa
\r
33 RIdI2h0W/S7vknI2NNfUZ7CFtBMr+PrcFQUKB4sygqMWFdpLQGdlEzLIy4qId6nc9xzK
\r
36 ALoCoQmzxuV9WF2x2XKkPU9qsv7pUsrtf4ANfoThit/omK/Oul43iQ/ipBGOWKQ7zFAT8N/dlJ+F
\r
37 X-Received: by 10.204.62.201 with SMTP id y9mr1546025bkh.23.1376852273669;
\r
38 Sun, 18 Aug 2013 11:57:53 -0700 (PDT)
\r
39 Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi.
\r
40 [88.195.111.91]) by mx.google.com with ESMTPSA id
\r
41 if11sm1085185bkc.15.1969.12.31.16.00.00
\r
42 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
\r
43 Sun, 18 Aug 2013 11:57:52 -0700 (PDT)
\r
44 From: Jani Nikula <jani@nikula.org>
\r
45 To: Tomi Ollila <tomi.ollila@iki.fi>, notmuch@notmuchmail.org
\r
46 Subject: Re: [PATCH] lib: fix clang build
\r
47 In-Reply-To: <m2txim7sjk.fsf@guru.guru-group.fi>
\r
48 References: <1376775001-16528-1-git-send-email-jani@nikula.org>
\r
49 <m2txim7sjk.fsf@guru.guru-group.fi>
\r
50 User-Agent: Notmuch/0.15.2+227~g40b2846 (http://notmuchmail.org) Emacs/24.3.1
\r
51 (x86_64-pc-linux-gnu)
\r
52 Date: Sun, 18 Aug 2013 21:57:52 +0300
\r
53 Message-ID: <87r4dqesi7.fsf@nikula.org>
\r
55 Content-Type: text/plain
\r
56 Cc: Simonas Kazlauskas <s@kazlauskas.me>
\r
57 X-BeenThere: notmuch@notmuchmail.org
\r
58 X-Mailman-Version: 2.1.13
\r
60 List-Id: "Use and development of the notmuch mail system."
\r
61 <notmuch.notmuchmail.org>
\r
62 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
63 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
64 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
65 List-Post: <mailto:notmuch@notmuchmail.org>
\r
66 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
67 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
68 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
69 X-List-Received-Date: Sun, 18 Aug 2013 18:58:01 -0000
\r
71 On Sun, 18 Aug 2013, Tomi Ollila <tomi.ollila@iki.fi> wrote:
\r
72 > On Sun, Aug 18 2013, Jani Nikula <jani@nikula.org> wrote:
\r
74 >> Long story short, fix build on recent (3.2+) clang.
\r
76 >> The long story for posterity follows.
\r
78 >> gcc 4.6 added new warnings about structs with greater visibility than
\r
79 >> their fields. The warnings were silenced by adjusting visibility in
\r
81 >> commit d5523ead90b6be2b07d4af745b8ed9b980a6b9f1
\r
82 >> Author: Carl Worth <cworth@cworth.org>
\r
83 >> Date: Wed May 11 13:23:13 2011 -0700
\r
85 >> Mark some structures in the library interface with visibility=default attribute.
\r
89 >> commit 3b76adf9e2c026dd03b820f4c6eab50e25444113
\r
90 >> Author: Austin Clements <amdragon@MIT.EDU>
\r
91 >> Date: Sat Jan 14 19:17:33 2012 -0500
\r
93 >> lib: Add support for automatically excluding tags from queries
\r
95 >> changed visibility of struct _notmuch_string_list for the same reason, and
\r
97 >> commit 1a53f9f116fa7c460cda3df532be921baaafb082
\r
98 >> Author: Mark Walters <markwalters1009@gmail.com>
\r
99 >> Date: Thu Mar 1 22:30:38 2012 +0000
\r
101 >> lib: Add the exclude flag to notmuch_query_search_threads
\r
103 >> split the struct _notmuch_string_list and its typedef
\r
104 >> notmuch_string_list_t as a way to make a forward declaration for
\r
105 >> _notmuch_thread_create().
\r
107 >> The subtle difference was that the struct definition now had 'visible'
\r
108 >> in it, while the typedef didn't, and it was within the #pragma GCC
\r
109 >> visibility push(hidden) block. This went unnoticed, as the then common
\r
110 >> versions of clang didn't care about this.
\r
112 >> A later change in clang (I did not dig into when this change was
\r
113 >> introduced) caused the following error:
\r
115 >> CXX -O2 lib/database.o
\r
116 >> In file included from lib/database.cc:21:
\r
117 >> In file included from ./lib/database-private.h:33:
\r
118 >> ./lib/notmuch-private.h:479:8: error: visibility does not match previous declaration
\r
119 >> struct visible _notmuch_string_list {
\r
121 >> ./lib/notmuch-private.h:67:33: note: expanded from macro 'visible'
\r
123 >> ./lib/notmuch-private.h:52:13: note: previous attribute is here
\r
125 >> 1 error generated.
\r
126 >> make: *** [lib/database.o] Error 1
\r
128 >> This is slightly misleading due to the reference to the #pragma. The
\r
129 >> real culprit is the typedef within the #pragma.
\r
131 >> We could just add 'visible' to the typedef, or move the typedef
\r
132 >> outside of the #pragma, and be done with it, but juggle the
\r
133 >> declarations a bit to accommodate moving the typedef back with the
\r
134 >> struct, and keep the visibility attribute in one place.
\r
136 >> The problem was originally reported by Simonas Kazlauskas
\r
137 >> <s@kazlauskas.me> in id:20130418102507.GA23688@godbox but I was only
\r
138 >> able to reproduce and investigate now that I upgraded clang.
\r
140 >> lib/notmuch-private.h | 28 +++++++++++++---------------
\r
141 >> 1 file changed, 13 insertions(+), 15 deletions(-)
\r
143 >> diff --git a/lib/notmuch-private.h b/lib/notmuch-private.h
\r
144 >> index eced03e..af185c7 100644
\r
145 >> --- a/lib/notmuch-private.h
\r
146 >> +++ b/lib/notmuch-private.h
\r
147 >> @@ -162,8 +162,6 @@ typedef enum _notmuch_find_flags {
\r
149 >> typedef struct _notmuch_doc_id_set notmuch_doc_id_set_t;
\r
151 > Looks good to me (except log message is a bit excessive (?) maybe
\r
152 > it is reasonable to have it, though (TL;DR ;)...
\r
154 >> -typedef struct _notmuch_string_list notmuch_string_list_t;
\r
159 > typedef struct visible _notmuch_string_list notmuch_string_list_t;
\r
161 > have helped here (if yes is your resolution nicer ?? :D )
\r
163 Yes, it would have. Read the commit message! :p
\r
172 >> /* database.cc */
\r
174 >> /* Lookup a prefix value by name.
\r
175 >> @@ -228,17 +226,6 @@ _notmuch_directory_create (notmuch_database_t *notmuch,
\r
177 >> _notmuch_directory_get_document_id (notmuch_directory_t *directory);
\r
179 >> -/* thread.cc */
\r
181 >> -notmuch_thread_t *
\r
182 >> -_notmuch_thread_create (void *ctx,
\r
183 >> - notmuch_database_t *notmuch,
\r
184 >> - unsigned int seed_doc_id,
\r
185 >> - notmuch_doc_id_set_t *match_set,
\r
186 >> - notmuch_string_list_t *excluded_terms,
\r
187 >> - notmuch_exclude_t omit_exclude,
\r
188 >> - notmuch_sort_t sort);
\r
190 >> /* message.cc */
\r
192 >> notmuch_message_t *
\r
193 >> @@ -476,11 +463,11 @@ typedef struct _notmuch_string_node {
\r
194 >> struct _notmuch_string_node *next;
\r
195 >> } notmuch_string_node_t;
\r
197 >> -struct visible _notmuch_string_list {
\r
198 >> +typedef struct visible _notmuch_string_list {
\r
200 >> notmuch_string_node_t *head;
\r
201 >> notmuch_string_node_t **tail;
\r
203 >> +} notmuch_string_list_t;
\r
205 >> notmuch_string_list_t *
\r
206 >> _notmuch_string_list_create (const void *ctx);
\r
207 >> @@ -509,6 +496,17 @@ notmuch_filenames_t *
\r
208 >> _notmuch_filenames_create (const void *ctx,
\r
209 >> notmuch_string_list_t *list);
\r
211 >> +/* thread.cc */
\r
213 >> +notmuch_thread_t *
\r
214 >> +_notmuch_thread_create (void *ctx,
\r
215 >> + notmuch_database_t *notmuch,
\r
216 >> + unsigned int seed_doc_id,
\r
217 >> + notmuch_doc_id_set_t *match_set,
\r
218 >> + notmuch_string_list_t *excluded_terms,
\r
219 >> + notmuch_exclude_t omit_exclude,
\r
220 >> + notmuch_sort_t sort);
\r
222 >> NOTMUCH_END_DECLS
\r
224 >> #ifdef __cplusplus
\r
228 >> _______________________________________________
\r
229 >> notmuch mailing list
\r
230 >> notmuch@notmuchmail.org
\r
231 >> http://notmuchmail.org/mailman/listinfo/notmuch
\r