[PATCH v3 03/16] make shared crypto code behave library-like
[notmuch-archives.git] / b2 / d3b9e31332ce2f99ba8e483594141f77f5eac8
1 Return-Path: <cworth@cworth.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 4113F431FBF;\r
6         Sun, 22 Nov 2009 19:22:23 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 Received: from olra.theworths.org ([127.0.0.1])\r
9         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
10         with ESMTP id aLx7U7PeLLRP; Sun, 22 Nov 2009 19:22:22 -0800 (PST)\r
11 Received: from cworth.org (localhost [127.0.0.1])\r
12         by olra.theworths.org (Postfix) with ESMTP id 302F2431FAE;\r
13         Sun, 22 Nov 2009 19:22:22 -0800 (PST)\r
14 From: Carl Worth <cworth@cworth.org>\r
15 To: djcb@djcbsoftware.nl, "notmuch\@notmuchmail org" <notmuch@notmuchmail.org>\r
16 In-Reply-To: <87d43ay4qg.wl%djcb@djcbsoftware.nl>\r
17 References: <87d43ay4qg.wl%djcb@djcbsoftware.nl>\r
18 Date: Mon, 23 Nov 2009 04:22:07 +0100\r
19 Message-ID: <87vdh2exi8.fsf@yoom.home.cworth.org>\r
20 MIME-Version: 1.0\r
21 Content-Type: text/plain; charset=us-ascii\r
22 Subject: Re: [notmuch] [PATCH] fix compiler warnings\r
23 X-BeenThere: notmuch@notmuchmail.org\r
24 X-Mailman-Version: 2.1.12\r
25 Precedence: list\r
26 List-Id: "Use and development of the notmuch mail system."\r
27         <notmuch.notmuchmail.org>\r
28 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
29         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
30 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
31 List-Post: <mailto:notmuch@notmuchmail.org>\r
32 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
33 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
34         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
35 X-List-Received-Date: Mon, 23 Nov 2009 03:22:23 -0000\r
36 \r
37 On Sun, 22 Nov 2009 17:11:03 +0200, Dirk-Jan C. Binnema <djcb.bulk@gmail.com> wrote:\r
38\r
39 > (hopefully this is the correct way to send patches...)\r
40 \r
41 Looks just fine, and welcome to notmuch!\r
42 \r
43 > With these minor changes, notmuch compiles warning-free with gcc 4.4.1\r
44 \r
45 Could you resend these as separate patches, each patch fixing a single\r
46 type of warning? That would make it more clear what the code is doing.\r
47 \r
48 > -    write(2, msg, sizeof(msg)-1);\r
49 > +    if (write(2, msg, sizeof(msg)-1) < 0) {\r
50 > +         /* ignore...*/\r
51 > +    }\r
52 \r
53 I don't like the gratuitous conditional here. It clutters the code and\r
54 make is less clear. If we're just trying to squelch a warning about an\r
55 unused return value from a function, then I think I'd rather see:\r
56 \r
57         ssize_t ignored;\r
58 \r
59         ignored = write (2, msg, sizeof (msg) - 1);\r
60 \r
61 What do you think?\r
62 \r
63 -Carl\r