Re: [PATCH 2/2] emacs: prefer notmuch-emacs-version in User-Agent: header
[notmuch-archives.git] / 4c / 6abac426a38b160ae3016bf098919943bb0cef
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 48669431FBC\r
6         for <notmuch@notmuchmail.org>; Sat, 17 Aug 2013 14:30:07 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \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 V-WK4gyobssi for <notmuch@notmuchmail.org>;\r
16         Sat, 17 Aug 2013 14:30:01 -0700 (PDT)\r
17 Received: from mail-bk0-f50.google.com (mail-bk0-f50.google.com\r
18         [209.85.214.50]) (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 83674431FAE\r
21         for <notmuch@notmuchmail.org>; Sat, 17 Aug 2013 14:30:01 -0700 (PDT)\r
22 Received: by mail-bk0-f50.google.com with SMTP id mz11so1046185bkb.9\r
23         for <notmuch@notmuchmail.org>; Sat, 17 Aug 2013 14:30:00 -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:date:message-id;\r
27         bh=r9H7n3z2BQT3k5X8dNh2XgLVm9MJ5Z0o/K5o96V4TD4=;\r
28         b=PxwqAj2tgOa2pJlb8xgghJYNr+f2C2BlWP+jhoWUTKjI8fsCp5ump7m6rIE9ILXZUg\r
29         DQMaKwvC7aIwz+CL2BdYpUjDRIzSMrWx/EQZwf6T6FjeGtkqa5OP5hNEWqg04L4BZE9n\r
30         F/kaXWtdbQ9z6YMdXPPgPLHHCYar6626fCpXvJOxF4SjWNN7oC2Jz+jumqKTi426ERTe\r
31         19yWW7Godjuf4KTi574RW5iwqhh73AIyeZx4Hy7D7f5adKIs+i94G+wMksSKb8+HqU6H\r
32         ndCaxiO76bgtB9nkH6Oqbqgz/nnGaSgffqp34YPoO+/zQIhuUjyL479IzqiJmii2XzWc\r
33         MJTQ==\r
34 X-Gm-Message-State:\r
35  ALoCoQlKCOGAA9ITryPj3r1mvbsrGcTr4PzT71DxzG3u3dfzUP38cIZt1GaKPes/DTBOTHez2BqM\r
36 X-Received: by 10.204.188.200 with SMTP id db8mr2663989bkb.12.1376774998912;\r
37         Sat, 17 Aug 2013 14:29:58 -0700 (PDT)\r
38 Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi.\r
39         [88.195.111.91])\r
40         by mx.google.com with ESMTPSA id m6sm552985bki.7.1969.12.31.16.00.00\r
41         (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
42         Sat, 17 Aug 2013 14:29:58 -0700 (PDT)\r
43 From: Jani Nikula <jani@nikula.org>\r
44 To: notmuch@notmuchmail.org\r
45 Subject: [PATCH] lib: fix clang build\r
46 Date: Sun, 18 Aug 2013 00:30:01 +0300\r
47 Message-Id: <1376775001-16528-1-git-send-email-jani@nikula.org>\r
48 X-Mailer: git-send-email 1.7.10.4\r
49 Cc: Simonas Kazlauskas <s@kazlauskas.me>\r
50 X-BeenThere: notmuch@notmuchmail.org\r
51 X-Mailman-Version: 2.1.13\r
52 Precedence: list\r
53 List-Id: "Use and development of the notmuch mail system."\r
54         <notmuch.notmuchmail.org>\r
55 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
56         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
57 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
58 List-Post: <mailto:notmuch@notmuchmail.org>\r
59 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
60 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
61         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
62 X-List-Received-Date: Sat, 17 Aug 2013 21:30:07 -0000\r
63 \r
64 Long story short, fix build on recent (3.2+) clang.\r
65 \r
66 The long story for posterity follows.\r
67 \r
68 gcc 4.6 added new warnings about structs with greater visibility than\r
69 their fields. The warnings were silenced by adjusting visibility in\r
70 \r
71 commit d5523ead90b6be2b07d4af745b8ed9b980a6b9f1\r
72 Author: Carl Worth <cworth@cworth.org>\r
73 Date:   Wed May 11 13:23:13 2011 -0700\r
74 \r
75     Mark some structures in the library interface with visibility=default attribute.\r
76 \r
77 Later on,\r
78 \r
79 commit 3b76adf9e2c026dd03b820f4c6eab50e25444113\r
80 Author: Austin Clements <amdragon@MIT.EDU>\r
81 Date:   Sat Jan 14 19:17:33 2012 -0500\r
82 \r
83     lib: Add support for automatically excluding tags from queries\r
84 \r
85 changed visibility of struct _notmuch_string_list for the same reason, and\r
86 \r
87 commit 1a53f9f116fa7c460cda3df532be921baaafb082\r
88 Author: Mark Walters <markwalters1009@gmail.com>\r
89 Date:   Thu Mar 1 22:30:38 2012 +0000\r
90 \r
91     lib: Add the exclude flag to notmuch_query_search_threads\r
92 \r
93 split the struct _notmuch_string_list and its typedef\r
94 notmuch_string_list_t as a way to make a forward declaration for\r
95 _notmuch_thread_create().\r
96 \r
97 The subtle difference was that the struct definition now had 'visible'\r
98 in it, while the typedef didn't, and it was within the #pragma GCC\r
99 visibility push(hidden) block. This went unnoticed, as the then common\r
100 versions of clang didn't care about this.\r
101 \r
102 A later change in clang (I did not dig into when this change was\r
103 introduced) caused the following error:\r
104 \r
105 CXX  -O2 lib/database.o\r
106 In file included from lib/database.cc:21:\r
107 In file included from ./lib/database-private.h:33:\r
108 ./lib/notmuch-private.h:479:8: error: visibility does not match previous declaration\r
109 struct visible _notmuch_string_list {\r
110        ^\r
111 ./lib/notmuch-private.h:67:33: note: expanded from macro 'visible'\r
112                                 ^\r
113 ./lib/notmuch-private.h:52:13: note: previous attribute is here\r
114             ^\r
115 1 error generated.\r
116 make: *** [lib/database.o] Error 1\r
117 \r
118 This is slightly misleading due to the reference to the #pragma. The\r
119 real culprit is the typedef within the #pragma.\r
120 \r
121 We could just add 'visible' to the typedef, or move the typedef\r
122 outside of the #pragma, and be done with it, but juggle the\r
123 declarations a bit to accommodate moving the typedef back with the\r
124 struct, and keep the visibility attribute in one place.\r
125 \r
126 The problem was originally reported by Simonas Kazlauskas\r
127 <s@kazlauskas.me> in id:20130418102507.GA23688@godbox but I was only\r
128 able to reproduce and investigate now that I upgraded clang.\r
129 ---\r
130  lib/notmuch-private.h |   28 +++++++++++++---------------\r
131  1 file changed, 13 insertions(+), 15 deletions(-)\r
132 \r
133 diff --git a/lib/notmuch-private.h b/lib/notmuch-private.h\r
134 index eced03e..af185c7 100644\r
135 --- a/lib/notmuch-private.h\r
136 +++ b/lib/notmuch-private.h\r
137 @@ -162,8 +162,6 @@ typedef enum _notmuch_find_flags {\r
138  \r
139  typedef struct _notmuch_doc_id_set notmuch_doc_id_set_t;\r
140  \r
141 -typedef struct _notmuch_string_list notmuch_string_list_t;\r
142 -\r
143  /* database.cc */\r
144  \r
145  /* Lookup a prefix value by name.\r
146 @@ -228,17 +226,6 @@ _notmuch_directory_create (notmuch_database_t *notmuch,\r
147  unsigned int\r
148  _notmuch_directory_get_document_id (notmuch_directory_t *directory);\r
149  \r
150 -/* thread.cc */\r
151 -\r
152 -notmuch_thread_t *\r
153 -_notmuch_thread_create (void *ctx,\r
154 -                       notmuch_database_t *notmuch,\r
155 -                       unsigned int seed_doc_id,\r
156 -                       notmuch_doc_id_set_t *match_set,\r
157 -                       notmuch_string_list_t *excluded_terms,\r
158 -                       notmuch_exclude_t omit_exclude,\r
159 -                       notmuch_sort_t sort);\r
160 -\r
161  /* message.cc */\r
162  \r
163  notmuch_message_t *\r
164 @@ -476,11 +463,11 @@ typedef struct _notmuch_string_node {\r
165      struct _notmuch_string_node *next;\r
166  } notmuch_string_node_t;\r
167  \r
168 -struct visible _notmuch_string_list {\r
169 +typedef struct visible _notmuch_string_list {\r
170      int length;\r
171      notmuch_string_node_t *head;\r
172      notmuch_string_node_t **tail;\r
173 -};\r
174 +} notmuch_string_list_t;\r
175  \r
176  notmuch_string_list_t *\r
177  _notmuch_string_list_create (const void *ctx);\r
178 @@ -509,6 +496,17 @@ notmuch_filenames_t *\r
179  _notmuch_filenames_create (const void *ctx,\r
180                            notmuch_string_list_t *list);\r
181  \r
182 +/* thread.cc */\r
183 +\r
184 +notmuch_thread_t *\r
185 +_notmuch_thread_create (void *ctx,\r
186 +                       notmuch_database_t *notmuch,\r
187 +                       unsigned int seed_doc_id,\r
188 +                       notmuch_doc_id_set_t *match_set,\r
189 +                       notmuch_string_list_t *excluded_terms,\r
190 +                       notmuch_exclude_t omit_exclude,\r
191 +                       notmuch_sort_t sort);\r
192 +\r
193  NOTMUCH_END_DECLS\r
194  \r
195  #ifdef __cplusplus\r
196 -- \r
197 1.7.10.4\r
198 \r