Re: [PATCH v4 1/3] show: don't use hex literals in JSON output
[notmuch-archives.git] / 74 / ccc8f73b267ff8a6d77b2aa86c363f7fa94de6
1 Return-Path: <jeff@ocjtech.us>\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 CC825431FBF\r
6         for <notmuch@notmuchmail.org>; Sun, 22 Nov 2009 20:43:43 -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 OsiSZKtcZeEJ for <notmuch@notmuchmail.org>;\r
11         Sun, 22 Nov 2009 20:43:43 -0800 (PST)\r
12 Received: from mail-yx0-f204.google.com (mail-yx0-f204.google.com\r
13         [209.85.210.204])\r
14         by olra.theworths.org (Postfix) with ESMTP id 33DA3431FAE\r
15         for <notmuch@notmuchmail.org>; Sun, 22 Nov 2009 20:43:43 -0800 (PST)\r
16 Received: by yxe42 with SMTP id 42so5143036yxe.22\r
17         for <notmuch@notmuchmail.org>; Sun, 22 Nov 2009 20:43:42 -0800 (PST)\r
18 MIME-Version: 1.0\r
19 Received: by 10.90.22.17 with SMTP id 17mr742155agv.76.1258951422753; Sun, 22 \r
20         Nov 2009 20:43:42 -0800 (PST)\r
21 In-Reply-To: <87vdh2exi8.fsf@yoom.home.cworth.org>\r
22 References: <87d43ay4qg.wl%djcb@djcbsoftware.nl>\r
23         <87vdh2exi8.fsf@yoom.home.cworth.org>\r
24 Date: Sun, 22 Nov 2009 22:43:42 -0600\r
25 Message-ID: <935ead450911222043s59f3e185n8cb0d1c46bbe9f7a@mail.gmail.com>\r
26 From: Jeffrey Ollie <jeff@ocjtech.us>\r
27 To: Carl Worth <cworth@cworth.org>\r
28 Content-Type: text/plain; charset=UTF-8\r
29 Content-Transfer-Encoding: quoted-printable\r
30 Cc: "notmuch@notmuchmail org" <notmuch@notmuchmail.org>, djcb@djcbsoftware.nl\r
31 Subject: Re: [notmuch] [PATCH] fix compiler warnings\r
32 X-BeenThere: notmuch@notmuchmail.org\r
33 X-Mailman-Version: 2.1.12\r
34 Precedence: list\r
35 List-Id: "Use and development of the notmuch mail system."\r
36         <notmuch.notmuchmail.org>\r
37 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
38         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
39 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
40 List-Post: <mailto:notmuch@notmuchmail.org>\r
41 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
42 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
43         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
44 X-List-Received-Date: Mon, 23 Nov 2009 04:43:44 -0000\r
45 \r
46 On Sun, Nov 22, 2009 at 9:22 PM, Carl Worth <cworth@cworth.org> wrote:\r
47 > On Sun, 22 Nov 2009 17:11:03 +0200, Dirk-Jan C. Binnema <djcb.bulk@gmail.=\r
48 com> wrote:\r
49 >>\r
50 >> - =C2=A0 =C2=A0write(2, msg, sizeof(msg)-1);\r
51 >> + =C2=A0 =C2=A0if (write(2, msg, sizeof(msg)-1) < 0) {\r
52 >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* ignore...*/\r
53 >> + =C2=A0 =C2=A0}\r
54 >\r
55 > I don't like the gratuitous conditional here. It clutters the code and\r
56 > make is less clear. If we're just trying to squelch a warning about an\r
57 > unused return value from a function, then I think I'd rather see:\r
58 >\r
59 > =C2=A0 =C2=A0 =C2=A0 =C2=A0ssize_t ignored;\r
60 >\r
61 > =C2=A0 =C2=A0 =C2=A0 =C2=A0ignored =3D write (2, msg, sizeof (msg) - 1);\r
62 \r
63 Isn't the usual method for ignoring return values casting to void?\r
64 \r
65 (void) write (2, msg, sizeof (msg) - 1);\r
66 \r
67 --=20\r
68 Jeff Ollie\r