[PATCH] configure: add --without-api-docs option
[notmuch-archives.git] / a8 / af825b56d55e2974f5ccacddee76202502f4a6
1 Return-Path: <teythoon@jade-hamburg.de>\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 B8F40431FC0\r
6         for <notmuch@notmuchmail.org>; Mon, 24 Sep 2012 08:21:38 -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\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         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 L-6Ze7C1mmwQ for <notmuch@notmuchmail.org>;\r
16         Mon, 24 Sep 2012 08:21:37 -0700 (PDT)\r
17 Received: from mail.cryptobitch.de (cryptobitch.de [88.198.7.68])\r
18         (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 056E0431FAF\r
21         for <notmuch@notmuchmail.org>; Mon, 24 Sep 2012 08:21:36 -0700 (PDT)\r
22 Received: from mail.jade-hamburg.de (mail.jade-hamburg.de [85.183.11.228])\r
23         (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))\r
24         (No client certificate requested)\r
25         by mail.cryptobitch.de (Postfix) with ESMTPSA id B28075AB283\r
26         for <notmuch@notmuchmail.org>; Mon, 24 Sep 2012 17:21:35 +0200 (CEST)\r
27 Received: by mail.jade-hamburg.de (Postfix, from userid 401)\r
28         id 1B0F0DF2A9; Mon, 24 Sep 2012 17:21:35 +0200 (CEST)\r
29 Received: from thinkbox.jade-hamburg.de (mail.jade-hamburg.de [85.183.11.228])\r
30         (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))\r
31         (No client certificate requested) (Authenticated sender: teythoon)\r
32         by mail.jade-hamburg.de (Postfix) with ESMTPSA id 0B627DF2A2;\r
33         Mon, 24 Sep 2012 17:21:32 +0200 (CEST)\r
34 Received: from teythoon by thinkbox.jade-hamburg.de with local (Exim 4.80)\r
35         (envelope-from <teythoon@thinkbox.jade-hamburg.de>)\r
36         id 1TGATR-0007lJ-0x; Mon, 24 Sep 2012 17:21:29 +0200\r
37 From: Justus Winter <4winter@informatik.uni-hamburg.de>\r
38 To: notmuch@notmuchmail.org\r
39 Subject: [PATCH 5/6] Annotate internal_error with the attribute noreturn\r
40 Date: Mon, 24 Sep 2012 17:21:19 +0200\r
41 Message-Id:\r
42  <1348500080-29726-5-git-send-email-4winter@informatik.uni-hamburg.de>\r
43 X-Mailer: git-send-email 1.7.10.4\r
44 In-Reply-To:\r
45  <1348500080-29726-1-git-send-email-4winter@informatik.uni-hamburg.de>\r
46 References: <873927eb5i.fsf@convex-new.cs.unb.ca>\r
47         <1348500080-29726-1-git-send-email-4winter@informatik.uni-hamburg.de>\r
48 X-BeenThere: notmuch@notmuchmail.org\r
49 X-Mailman-Version: 2.1.13\r
50 Precedence: list\r
51 List-Id: "Use and development of the notmuch mail system."\r
52         <notmuch.notmuchmail.org>\r
53 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
54         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
55 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
56 List-Post: <mailto:notmuch@notmuchmail.org>\r
57 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
58 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
59         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
60 X-List-Received-Date: Mon, 24 Sep 2012 15:21:38 -0000\r
61 \r
62 Annotating functions that do not return with the noreturn attribute\r
63 (which is understood by both gcc and clang) prevents static analyzers\r
64 from generating false positives (internal_error is used to terminate\r
65 the process and is used extensively in error handling code paths).\r
66 \r
67 Remove the return statement that was placed there to appease the\r
68 compiler. Functions annotated with noreturn are not supposed to return\r
69 any values.\r
70 \r
71 Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>\r
72 ---\r
73  util/error_util.c |    4 +---\r
74  util/error_util.h |    6 ++++--\r
75  2 files changed, 5 insertions(+), 5 deletions(-)\r
76 \r
77 diff --git a/util/error_util.c b/util/error_util.c\r
78 index 630d228..d6e60fc 100644\r
79 --- a/util/error_util.c\r
80 +++ b/util/error_util.c\r
81 @@ -24,7 +24,7 @@\r
82  \r
83  #include "error_util.h"\r
84  \r
85 -int\r
86 +void\r
87  _internal_error (const char *format, ...)\r
88  {\r
89      va_list va_args;\r
90 @@ -35,7 +35,5 @@ _internal_error (const char *format, ...)\r
91      vfprintf (stderr, format, va_args);\r
92  \r
93      exit (1);\r
94 -\r
95 -    return 1;\r
96  }\r
97  \r
98 diff --git a/util/error_util.h b/util/error_util.h\r
99 index bb15822..17c8727 100644\r
100 --- a/util/error_util.h\r
101 +++ b/util/error_util.h\r
102 @@ -23,14 +23,16 @@\r
103  \r
104  #include <talloc.h>\r
105  \r
106 +#include "function-attributes.h"\r
107 +\r
108  /* There's no point in continuing when we've detected that we've done\r
109   * something wrong internally (as opposed to the user passing in a\r
110   * bogus value).\r
111   *\r
112   * Note that PRINTF_ATTRIBUTE comes from talloc.h\r
113   */\r
114 -int\r
115 -_internal_error (const char *format, ...) PRINTF_ATTRIBUTE (1, 2);\r
116 +void\r
117 +_internal_error (const char *format, ...) PRINTF_ATTRIBUTE (1, 2) NORETURN_ATTRIBUTE;\r
118  \r
119  /* There's no point in continuing when we've detected that we've done\r
120   * something wrong internally (as opposed to the user passing in a\r
121 -- \r
122 1.7.10.4\r
123 \r