qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Raghavendra D Prabhu <rprabhu@wnohang.net>,
	qemu-devel@nongnu.org,
	Raghavendra D Prabhu <raghu.prabhu13@gmail.com>,
	kvm@vger.kernel.org
Subject: Re: [Qemu-devel] [PATCH 3/3] Avoid Wunsed-but-set warnings (or errors in case of Werror)
Date: Tue, 05 Jul 2011 10:05:04 +0200	[thread overview]
Message-ID: <4E12C5B0.3040704@redhat.com> (raw)
In-Reply-To: <m34o31b1zv.fsf@blackfin.pond.sub.org>

On 07/05/2011 09:49 AM, Markus Armbruster wrote:
> >  If 'ret' has been used to silence compiler warnings about functions
> >  which have been declared with attribute __warn_unused_result__
> >  (eg write() and various other libc functions) then "(void)write()"
> >  is insufficient -- gcc requires the variable.
>
> gcc being silly.  Oh well.

In this particular case I think that the return value should be checked. 
  It's good if something is printed in the log saying that the reset 
wasn't done for some reason---even if it is just defensive.

The really silly thing is in glibc, not gcc.  __warn_unused_result__ was 
added to fwrite, where you have no certainty that the write has been 
done, but not to either fclose or fflush.  Oh well...

Paolo

      reply	other threads:[~2011-07-05  8:05 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-04 21:59 [Qemu-devel] [PATCH 0/3] Build fixes Raghavendra D Prabhu
2011-07-04 22:00 ` [Qemu-devel] [PATCH 1/3] Avoid the use of deprecated gnutls gnutls_*_set_priority functions Raghavendra D Prabhu
2011-08-22  8:26   ` Stefan Hajnoczi
2011-08-22 10:13     ` Gerd Hoffmann
2011-08-25 10:54   ` Stefan Hajnoczi
2011-08-25 11:02     ` Daniel P. Berrange
2011-07-04 22:00 ` [Qemu-devel] [PATCH 2/3] Add fno-strict-overflow Raghavendra D Prabhu
2011-07-04 22:38   ` Peter Maydell
2011-07-05  5:41     ` Stefan Hajnoczi
2011-07-05  9:34       ` Stefan Hajnoczi
2011-07-05 15:36     ` Raghavendra D Prabhu
2011-07-05 20:30       ` Stefan Hajnoczi
2011-07-07 21:51         ` Raghavendra D Prabhu
2011-07-04 22:00 ` [Qemu-devel] [PATCH 3/3] Avoid Wunsed-but-set warnings (or errors in case of Werror) Raghavendra D Prabhu
2011-07-05  6:15   ` Markus Armbruster
2011-07-05  7:02     ` Peter Maydell
2011-07-05  7:49       ` Markus Armbruster
2011-07-05  8:05         ` Paolo Bonzini [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

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

  git send-email \
    --in-reply-to=4E12C5B0.3040704@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=armbru@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=raghu.prabhu13@gmail.com \
    --cc=rprabhu@wnohang.net \
    /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.
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 NNTP newsgroup(s).