Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id CC825431FBF for ; Sun, 22 Nov 2009 20:43:43 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OsiSZKtcZeEJ for ; Sun, 22 Nov 2009 20:43:43 -0800 (PST) Received: from mail-yx0-f204.google.com (mail-yx0-f204.google.com [209.85.210.204]) by olra.theworths.org (Postfix) with ESMTP id 33DA3431FAE for ; Sun, 22 Nov 2009 20:43:43 -0800 (PST) Received: by yxe42 with SMTP id 42so5143036yxe.22 for ; Sun, 22 Nov 2009 20:43:42 -0800 (PST) MIME-Version: 1.0 Received: by 10.90.22.17 with SMTP id 17mr742155agv.76.1258951422753; Sun, 22 Nov 2009 20:43:42 -0800 (PST) In-Reply-To: <87vdh2exi8.fsf@yoom.home.cworth.org> References: <87d43ay4qg.wl%djcb@djcbsoftware.nl> <87vdh2exi8.fsf@yoom.home.cworth.org> Date: Sun, 22 Nov 2009 22:43:42 -0600 Message-ID: <935ead450911222043s59f3e185n8cb0d1c46bbe9f7a@mail.gmail.com> From: Jeffrey Ollie To: Carl Worth Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: "notmuch@notmuchmail org" , djcb@djcbsoftware.nl Subject: Re: [notmuch] [PATCH] fix compiler warnings X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 04:43:44 -0000 On Sun, Nov 22, 2009 at 9:22 PM, Carl Worth wrote: > On Sun, 22 Nov 2009 17:11:03 +0200, Dirk-Jan C. Binnema wrote: >> >> - =C2=A0 =C2=A0write(2, msg, sizeof(msg)-1); >> + =C2=A0 =C2=A0if (write(2, msg, sizeof(msg)-1) < 0) { >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* ignore...*/ >> + =C2=A0 =C2=A0} > > I don't like the gratuitous conditional here. It clutters the code and > make is less clear. If we're just trying to squelch a warning about an > unused return value from a function, then I think I'd rather see: > > =C2=A0 =C2=A0 =C2=A0 =C2=A0ssize_t ignored; > > =C2=A0 =C2=A0 =C2=A0 =C2=A0ignored =3D write (2, msg, sizeof (msg) - 1); Isn't the usual method for ignoring return values casting to void? (void) write (2, msg, sizeof (msg) - 1); --=20 Jeff Ollie