[PATCH v6 6/7] cli: search: Add --output=count
[notmuch-archives.git] / 4c / 37a30a4f7f6bc6b75eb3b0a538dc039f37e8bc
1 Return-Path: <amdragon@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 5E29F431FB6\r
6         for <notmuch@notmuchmail.org>; Sat, 22 Sep 2012 09:13:01 -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 YIS1LyeUFTfG for <notmuch@notmuchmail.org>;\r
16         Sat, 22 Sep 2012 09:13:00 -0700 (PDT)\r
17 Received: from dmz-mailsec-scanner-8.mit.edu (DMZ-MAILSEC-SCANNER-8.MIT.EDU\r
18         [18.7.68.37])\r
19         by olra.theworths.org (Postfix) with ESMTP id C6ADC431FAE\r
20         for <notmuch@notmuchmail.org>; Sat, 22 Sep 2012 09:13:00 -0700 (PDT)\r
21 X-AuditID: 12074425-b7fcc6d00000091f-ba-505de38b666c\r
22 Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])\r
23         by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id 77.7C.02335.B83ED505; Sat, 22 Sep 2012 12:12:59 -0400 (EDT)\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
26         by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id q8MGCwRg025912; \r
27         Sat, 22 Sep 2012 12:12:59 -0400\r
28 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\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 q8MGCuUU003058\r
32         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
33         Sat, 22 Sep 2012 12:12:58 -0400 (EDT)\r
34 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
35         (envelope-from <amdragon@mit.edu>)\r
36         id 1TFSK8-0005S4-Jk; Sat, 22 Sep 2012 12:12:56 -0400\r
37 Date: Sat, 22 Sep 2012 12:12:56 -0400\r
38 From: Austin Clements <amdragon@MIT.EDU>\r
39 To: Justus Winter <4winter@informatik.uni-hamburg.de>\r
40 Subject: Re: [PATCH 1/2] Annotate internal_error with the attribute noreturn\r
41 Message-ID: <20120922161256.GE26662@mit.edu>\r
42 References:\r
43  <1348231837-21700-1-git-send-email-4winter@informatik.uni-hamburg.de>\r
44 MIME-Version: 1.0\r
45 Content-Type: text/plain; charset=us-ascii\r
46 Content-Disposition: inline\r
47 In-Reply-To:\r
48  <1348231837-21700-1-git-send-email-4winter@informatik.uni-hamburg.de>\r
49 User-Agent: Mutt/1.5.21 (2010-09-15)\r
50 X-Brightmail-Tracker:\r
51  H4sIAAAAAAAAA+NgFmpmleLIzCtJLcpLzFFi42IR4hRV1u1+HBtgcKHbymJ26w8mi+s3ZzI7\r
52         MHlMPH+azePZqlvMAUxRXDYpqTmZZalF+nYJXBnz3txgKvjDW7FyzSTWBsap3F2MnBwSAiYS\r
53         cyc/Z4SwxSQu3FvP1sXIxSEksI9Rom/nM2YIZwOjRNv7G+wgVUICJ5kkVqwVg0gsYZSYuGMx\r
54         G0iCRUBVYvfBuSwgNpuAhsS2/cvBxooImEpsePAArJlZQFri2+9mJhBbWMBHYtvc68wgNq+A\r
55         jsSG/v2MEAsCJWZNeAsVF5Q4OfMJC0SvlsSNfy+BejnA5iz/xwES5hQIkjh8fQ9YiaiAisSU\r
56         k9vYJjAKzULSPQtJ9yyE7gWMzKsYZVNyq3RzEzNzilOTdYuTE/PyUot0LfRyM0v0UlNKNzGC\r
57         wprdRXUH44RDSocYBTgYlXh4N0yOCRBiTSwrrsw9xCjJwaQkynv4QmyAEF9SfkplRmJxRnxR\r
58         aU5q8SFGCQ5mJRFe85NAOd6UxMqq1KJ8mJQ0B4uSOO+NlJv+QgLpiSWp2ampBalFMFkZDg4l\r
59         Cd47j4AaBYtS01Mr0jJzShDSTBycIMN5gIZfAqnhLS5IzC3OTIfIn2JUlBLnfQuSEABJZJTm\r
60         wfXC0s4rRnGgV4R5b4BU8QBTFlz3K6DBTECD31yPAhlckoiQkmpgnPA8tChA71yT91vv7xWW\r
61         aydrOd1kTNfNNCqYYvmO98HW0ucfxDlYrnKzXlL6snWlCC/P5VV2v649ifJ939r//X0I1yQl\r
62         C7aDd57bnz5g+rrxT4fMGZ0oN38poRvFUZ1FL7VeeZqtT2bYdsf3qUDCVPY+B3vZOeluVaVR\r
63         H1q0VDV2+X5JyXdTYinOSDTUYi4qTgQAoMJxoRYDAAA=\r
64 Cc: notmuch@notmuchmail.org\r
65 X-BeenThere: notmuch@notmuchmail.org\r
66 X-Mailman-Version: 2.1.13\r
67 Precedence: list\r
68 List-Id: "Use and development of the notmuch mail system."\r
69         <notmuch.notmuchmail.org>\r
70 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
71         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
72 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
73 List-Post: <mailto:notmuch@notmuchmail.org>\r
74 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
75 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
76         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
77 X-List-Received-Date: Sat, 22 Sep 2012 16:13:01 -0000\r
78 \r
79 LGTM, though I agree with David that this should return void now, if\r
80 that's possible.\r
81 \r
82 Do we want to wrap the __attribute__((noreturn)) in an #ifdef __GNUC__\r
83 (or provide a PRINTF_ATTRIBUTE-like macro) or is that already a lost\r
84 cause?\r
85 \r
86 Quoth Justus Winter on Sep 21 at  2:50 pm:\r
87 > Annotating functions that do not return with the noreturn attribute\r
88 > (which is understood by both gcc and clang) prevents static analyzers\r
89 > from generating false positives (internal_error is used to terminate\r
90 > the process and is used extensively in error handling code paths).\r
91\r
92 > Remove the return statement that was placed there to appease the\r
93 > compiler. Functions annotated with noreturn are not supposed to return\r
94 > any values.\r
95\r
96 > Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>\r
97 > ---\r
98 >  util/error_util.c |    2 --\r
99 >  util/error_util.h |    2 +-\r
100 >  2 files changed, 1 insertion(+), 3 deletions(-)\r
101\r
102 > diff --git a/util/error_util.c b/util/error_util.c\r
103 > index 630d228..3cf353a 100644\r
104 > --- a/util/error_util.c\r
105 > +++ b/util/error_util.c\r
106 > @@ -35,7 +35,5 @@ _internal_error (const char *format, ...)\r
107 >      vfprintf (stderr, format, va_args);\r
108 >  \r
109 >      exit (1);\r
110 > -\r
111 > -    return 1;\r
112 >  }\r
113 >  \r
114 > diff --git a/util/error_util.h b/util/error_util.h\r
115 > index bb15822..24a644b 100644\r
116 > --- a/util/error_util.h\r
117 > +++ b/util/error_util.h\r
118 > @@ -30,7 +30,7 @@\r
119 >   * Note that PRINTF_ATTRIBUTE comes from talloc.h\r
120 >   */\r
121 >  int\r
122 > -_internal_error (const char *format, ...) PRINTF_ATTRIBUTE (1, 2);\r
123 > +_internal_error (const char *format, ...) PRINTF_ATTRIBUTE (1, 2) __attribute__ ((noreturn));\r
124 >  \r
125 >  /* There's no point in continuing when we've detected that we've done\r
126 >   * something wrong internally (as opposed to the user passing in a\r