unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Jeffrey Ollie <jeff@ocjtech.us>
To: Carl Worth <cworth@cworth.org>
Cc: "notmuch@notmuchmail org" <notmuch@notmuchmail.org>,
	djcb@djcbsoftware.nl
Subject: Re: [PATCH] fix compiler warnings
Date: Sun, 22 Nov 2009 22:43:42 -0600	[thread overview]
Message-ID: <935ead450911222043s59f3e185n8cb0d1c46bbe9f7a@mail.gmail.com> (raw)
In-Reply-To: <87vdh2exi8.fsf@yoom.home.cworth.org>

On Sun, Nov 22, 2009 at 9:22 PM, Carl Worth <cworth@cworth.org> wrote:
> On Sun, 22 Nov 2009 17:11:03 +0200, Dirk-Jan C. Binnema <djcb.bulk@gmail.com> wrote:
>>
>> -    write(2, msg, sizeof(msg)-1);
>> +    if (write(2, msg, sizeof(msg)-1) < 0) {
>> +         /* ignore...*/
>> +    }
>
> 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:
>
>        ssize_t ignored;
>
>        ignored = 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);

-- 
Jeff Ollie

      reply	other threads:[~2009-11-23  4:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-22 15:11 [PATCH] fix compiler warnings Dirk-Jan C. Binnema
2009-11-23  3:22 ` Carl Worth
2009-11-23  4:43   ` Jeffrey Ollie [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=935ead450911222043s59f3e185n8cb0d1c46bbe9f7a@mail.gmail.com \
    --to=jeff@ocjtech.us \
    --cc=cworth@cworth.org \
    --cc=djcb@djcbsoftware.nl \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).