1 Return-Path: <tomi.ollila@iki.fi>
\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 42511431FAF
\r
6 for <notmuch@notmuchmail.org>; Sat, 22 Sep 2012 13:03:37 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\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 KHrDBtxqfPtx for <notmuch@notmuchmail.org>;
\r
16 Sat, 22 Sep 2012 13:03:36 -0700 (PDT)
\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])
\r
18 by olra.theworths.org (Postfix) with ESMTP id 33198431FAE
\r
19 for <notmuch@notmuchmail.org>; Sat, 22 Sep 2012 13:03:36 -0700 (PDT)
\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])
\r
21 by guru.guru-group.fi (Postfix) with ESMTP id 9E0E310014F;
\r
22 Sat, 22 Sep 2012 23:03:40 +0300 (EEST)
\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>
\r
24 To: Austin Clements <amdragon@MIT.EDU>,
\r
25 Justus Winter <4winter@informatik.uni-hamburg.de>
\r
26 Subject: Re: [PATCH 1/2] Annotate internal_error with the attribute noreturn
\r
27 In-Reply-To: <20120922161256.GE26662@mit.edu>
\r
29 <1348231837-21700-1-git-send-email-4winter@informatik.uni-hamburg.de>
\r
30 <20120922161256.GE26662@mit.edu>
\r
31 User-Agent: Notmuch/0.13.2+177~g6720ee8 (http://notmuchmail.org) Emacs/24.2.1
\r
32 (x86_64-unknown-linux-gnu)
\r
33 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL
\r
34 $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F
\r
35 !)g;OY^,BjTbr)Np:%c_o'jj,Z
\r
36 Date: Sat, 22 Sep 2012 23:03:40 +0300
\r
37 Message-ID: <m2a9whlt9f.fsf@guru.guru-group.fi>
\r
39 Content-Type: text/plain
\r
40 Cc: notmuch@notmuchmail.org
\r
41 X-BeenThere: notmuch@notmuchmail.org
\r
42 X-Mailman-Version: 2.1.13
\r
44 List-Id: "Use and development of the notmuch mail system."
\r
45 <notmuch.notmuchmail.org>
\r
46 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
47 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
48 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
49 List-Post: <mailto:notmuch@notmuchmail.org>
\r
50 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
51 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
52 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
53 X-List-Received-Date: Sat, 22 Sep 2012 20:03:37 -0000
\r
55 On Sat, Sep 22 2012, Austin Clements wrote:
\r
57 > LGTM, though I agree with David that this should return void now, if
\r
60 > Do we want to wrap the __attribute__((noreturn)) in an #ifdef __GNUC__
\r
61 > (or provide a PRINTF_ATTRIBUTE-like macro) or is that already a lost
\r
64 Good point -- this should be NORETURN_ATTRIBUTE instead...
\r
66 Also, http://gcc.gnu.org/onlinedocs/gcc-4.3.2//gcc/Function-Attributes.html states:
\r
68 "It does not make sense for a noreturn function to have a return type other
\r
71 (I think that hasn't changed since :)
\r
76 > Quoth Justus Winter on Sep 21 at 2:50 pm:
\r
77 >> Annotating functions that do not return with the noreturn attribute
\r
78 >> (which is understood by both gcc and clang) prevents static analyzers
\r
79 >> from generating false positives (internal_error is used to terminate
\r
80 >> the process and is used extensively in error handling code paths).
\r
82 >> Remove the return statement that was placed there to appease the
\r
83 >> compiler. Functions annotated with noreturn are not supposed to return
\r
86 >> Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
\r
88 >> util/error_util.c | 2 --
\r
89 >> util/error_util.h | 2 +-
\r
90 >> 2 files changed, 1 insertion(+), 3 deletions(-)
\r
92 >> diff --git a/util/error_util.c b/util/error_util.c
\r
93 >> index 630d228..3cf353a 100644
\r
94 >> --- a/util/error_util.c
\r
95 >> +++ b/util/error_util.c
\r
96 >> @@ -35,7 +35,5 @@ _internal_error (const char *format, ...)
\r
97 >> vfprintf (stderr, format, va_args);
\r
104 >> diff --git a/util/error_util.h b/util/error_util.h
\r
105 >> index bb15822..24a644b 100644
\r
106 >> --- a/util/error_util.h
\r
107 >> +++ b/util/error_util.h
\r
108 >> @@ -30,7 +30,7 @@
\r
109 >> * Note that PRINTF_ATTRIBUTE comes from talloc.h
\r
112 >> -_internal_error (const char *format, ...) PRINTF_ATTRIBUTE (1, 2);
\r
113 >> +_internal_error (const char *format, ...) PRINTF_ATTRIBUTE (1, 2) __attribute__ ((noreturn));
\r
115 >> /* There's no point in continuing when we've detected that we've done
\r
116 >> * something wrong internally (as opposed to the user passing in a
\r
117 > _______________________________________________
\r
118 > notmuch mailing list
\r
119 > notmuch@notmuchmail.org
\r
120 > http://notmuchmail.org/mailman/listinfo/notmuch
\r