[PATCH 7/7] emacs: tree: use orig-tags in search
[notmuch-archives.git] / f3 / e1600d78be1935c9e68de0102d207eab8105e0
1 Return-Path: <amthrax@drake.mit.edu>\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 13DCE431FAF\r
6         for <notmuch@notmuchmail.org>; Thu, 19 Jan 2012 14:29:28 -0800 (PST)\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 6e9dQ1cOXwSv for <notmuch@notmuchmail.org>;\r
16         Thu, 19 Jan 2012 14:29:27 -0800 (PST)\r
17 Received: from dmz-mailsec-scanner-1.mit.edu (DMZ-MAILSEC-SCANNER-1.MIT.EDU\r
18         [18.9.25.12])\r
19         by olra.theworths.org (Postfix) with ESMTP id 023F2431FBD\r
20         for <notmuch@notmuchmail.org>; Thu, 19 Jan 2012 14:29:26 -0800 (PST)\r
21 X-AuditID: 1209190c-b7fad6d000000920-bc-4f189946e156\r
22 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36])\r
23         by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id 3A.F2.02336.649981F4; Thu, 19 Jan 2012 17:29:26 -0500 (EST)\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
26         by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id q0JMTQDS026612; \r
27         Thu, 19 Jan 2012 17:29:26 -0500\r
28 Received: from drake.mit.edu (26-4-166.dynamic.csail.mit.edu [18.26.4.166])\r
29         (authenticated bits=0)\r
30         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
31         by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q0JMTP8x010692\r
32         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
33         Thu, 19 Jan 2012 17:29:25 -0500 (EST)\r
34 Received: from amthrax by drake.mit.edu with local (Exim 4.77)\r
35         (envelope-from <amthrax@drake.mit.edu>)\r
36         id 1Ro0U0-000529-UL; Thu, 19 Jan 2012 17:29:25 -0500\r
37 From: Austin Clements <amdragon@MIT.EDU>\r
38 To: notmuch@notmuchmail.org\r
39 Subject: [PATCH v3 2/2] Silence buildbot warnings about unused results\r
40 Date: Thu, 19 Jan 2012 17:29:19 -0500\r
41 Message-Id: <1327012159-19242-3-git-send-email-amdragon@mit.edu>\r
42 X-Mailer: git-send-email 1.7.7.3\r
43 In-Reply-To: <1327012159-19242-1-git-send-email-amdragon@mit.edu>\r
44 References: <1326996065-29467-1-git-send-email-amdragon@mit.edu>\r
45         <1327012159-19242-1-git-send-email-amdragon@mit.edu>\r
46 X-Brightmail-Tracker:\r
47  H4sIAAAAAAAAA+NgFtrDIsWRmVeSWpSXmKPExsUixG6nous2U8LfoKFHwWLfnS1MFtdvzmR2\r
48         YPLY9fwvk8ezVbeYA5iiuGxSUnMyy1KL9O0SuDIunz3LXHBZqGLjglbWBsY9fF2MHBwSAiYS\r
49         9y4zdzFyApliEhfurWfrYuTiEBLYxyjx8tUFNpCEkMAGRolzOzUhEseZJN5+28YI4cxnlPhz\r
50         pZsRpIpNQENi2/7lYLaIgLTEzruzWUFsZgFjib/T54PZwgJuEmdat4CtYxFQlVj//yhYnFfA\r
51         QWLn3I1QZyhInFt9jh3E5hRwlJg1YS/UFeUS16f/YZnAyL+AkWEVo2xKbpVubmJmTnFqsm5x\r
52         cmJeXmqRrqFebmaJXmpK6SZGUCBxSvLsYHxzUOkQowAHoxIPL5erhL8Qa2JZcWXuIUZJDiYl\r
53         Ud5t04FCfEn5KZUZicUZ8UWlOanFhxglOJiVRHgb+oByvCmJlVWpRfkwKWkOFiVxXhWtd35C\r
54         AumJJanZqakFqUUwWRkODiUJ3uUzgBoFi1LTUyvSMnNKENJMHJwgw3mAhi8EqeEtLkjMLc5M\r
55         h8ifYlSUEuc9DJIQAElklObB9cIi/RWjONArwryLQKp4gEkCrvsV0GAmoMEeTWIgg0sSEVJS\r
56         DYwuU/SmFmztnczxos0nX8VObcaTn97cM44U7gi7KrfDyHu3qMzGUsESb3//Ew+2Mhq75Eub\r
57         7Dxqd/1K1N2Zu+ZsOzRrhV6vdul7KVX+F5NFs3vzTy9c8vUqR2iiwE7Dj7GKmqvOnmtbYVRt\r
58         XfFgpt2nrDNLzthsN2/hczokzLBGTFswOoPzwy4lluKMREMt5qLiRADAng2zzwIAAA==\r
59 X-BeenThere: notmuch@notmuchmail.org\r
60 X-Mailman-Version: 2.1.13\r
61 Precedence: list\r
62 List-Id: "Use and development of the notmuch mail system."\r
63         <notmuch.notmuchmail.org>\r
64 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
65         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
66 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
67 List-Post: <mailto:notmuch@notmuchmail.org>\r
68 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
69 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
70         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
71 X-List-Received-Date: Thu, 19 Jan 2012 22:29:28 -0000\r
72 \r
73 This ignores the results of the two writes in sigint handlers even\r
74 harder than before.\r
75 \r
76 While my libc lacks the declarations that trigger these warnings, this\r
77 can be tested by adding the following to notmuch.h:\r
78 \r
79 __attribute__((warn_unused_result))\r
80 ssize_t write(int fd, const void *buf, size_t count);\r
81 ---\r
82  compat/compat.h |    8 ++++++++\r
83  notmuch-new.c   |    6 +++++-\r
84  notmuch-tag.c   |    7 ++++++-\r
85  3 files changed, 19 insertions(+), 2 deletions(-)\r
86 \r
87 diff --git a/compat/compat.h b/compat/compat.h\r
88 index 7767fe8..b2e2736 100644\r
89 --- a/compat/compat.h\r
90 +++ b/compat/compat.h\r
91 @@ -46,6 +46,14 @@ getdelim (char **lineptr, size_t *n, int delimiter, FILE *fp);\r
92  char* strcasestr(const char *haystack, const char *needle);\r
93  #endif /* !HAVE_STRCASESTR */\r
94  \r
95 +/* Silence gcc warnings about unused results.  These warnings exist\r
96 + * for a reason; any use of this needs to be justified. */\r
97 +#ifdef __GNUC__\r
98 +#define IGNORE_RESULT(x) ({ __typeof__(x) __z = (x); (void)(__z = __z); })\r
99 +#else /* !__GNUC__ */\r
100 +#define IGNORE_RESULT(x) x\r
101 +#endif /* __GNUC__ */\r
102 +\r
103  #ifdef __cplusplus\r
104  }\r
105  #endif\r
106 diff --git a/notmuch-new.c b/notmuch-new.c\r
107 index 3512de7..a569a54 100644\r
108 --- a/notmuch-new.c\r
109 +++ b/notmuch-new.c\r
110 @@ -67,7 +67,11 @@ handle_sigint (unused (int sig))\r
111  {\r
112      static char msg[] = "Stopping...         \n";\r
113  \r
114 -    (void) write(2, msg, sizeof(msg)-1);\r
115 +    /* This write is "opportunistic", so it's okay to ignore the\r
116 +     * result.  It is not required for correctness, and if it does\r
117 +     * fail or produce a short write, we want to get out of the signal\r
118 +     * handler as quickly as possible, not retry it. */\r
119 +    IGNORE_RESULT (write (2, msg, sizeof(msg)-1));\r
120      interrupted = 1;\r
121  }\r
122  \r
123 diff --git a/notmuch-tag.c b/notmuch-tag.c\r
124 index 292c5da..44fd61f 100644\r
125 --- a/notmuch-tag.c\r
126 +++ b/notmuch-tag.c\r
127 @@ -26,7 +26,12 @@ static void\r
128  handle_sigint (unused (int sig))\r
129  {\r
130      static char msg[] = "Stopping...         \n";\r
131 -    (void) write(2, msg, sizeof(msg)-1);\r
132 +\r
133 +    /* This write is "opportunistic", so it's okay to ignore the\r
134 +     * result.  It is not required for correctness, and if it does\r
135 +     * fail or produce a short write, we want to get out of the signal\r
136 +     * handler as quickly as possible, not retry it. */\r
137 +    IGNORE_RESULT (write (2, msg, sizeof(msg)-1));\r
138      interrupted = 1;\r
139  }\r
140  \r
141 -- \r
142 1.7.7.3\r
143 \r