All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Richard W.M. Jones" <rjones@redhat.com>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: qemu-trivial@nongnu.org, lersek@redhat.com,
	qemu-devel@nongnu.org, dgilbert@redhat.com
Subject: Re: [Qemu-trivial] [PATCH] Fix comparisons between implicit booleans and integers.
Date: Tue, 10 Feb 2015 19:33:22 +0000	[thread overview]
Message-ID: <20150210193322.GN11603@redhat.com> (raw)
In-Reply-To: <54DA58D7.8080400@msgid.tls.msk.ru>

On Tue, Feb 10, 2015 at 10:15:35PM +0300, Michael Tokarev wrote:
> 30.01.2015 14:52, Richard W.M. Jones wrote:
> > In GCC 5 there is a new warning (-Wlogical-not-parentheses) which
> > prevents you from writing:
> > 
> >   if (<some implicitly boolean expression> == <an int>) ...
> > 
> > A typical error would be:
> > 
> > kvm-all.c: In function ‘kvm_set_migration_log’:
> > kvm-all.c:383:54: error: logical not is only applied to the left hand side of comparison [-Werror=logical-not-parentheses]
> >          if (!!(mem->flags & KVM_MEM_LOG_DIRTY_PAGES) == enable) {
> > 
> > Fix a few places where the build is now broken in GCC 5.
> > 
> > The warning isn't even consistent, as with the place in
> > hw/net/virtio-net.c where I had to cast an obviously boolean
> > expression to bool.
> 
> Richard, I'd like to apply hunks 2 and 3, but leave out hunk 1
> for now.  As a start, the hunk 1 looks a bit, well, ugly, don't
> you think?  But if I just drop hunk 1, the commit message will
> be a bit misleading, since it describes exactly the hunk1 change...

Please feel free to apply and bits and modify the commit message as
you wish.  I just want qemu to be fixed on gcc 5, I don't care how we
get there :-)

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-builder quickly builds VMs from scratch
http://libguestfs.org/virt-builder.1.html


WARNING: multiple messages have this Message-ID (diff)
From: "Richard W.M. Jones" <rjones@redhat.com>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: qemu-trivial@nongnu.org, lersek@redhat.com,
	qemu-devel@nongnu.org, dgilbert@redhat.com
Subject: Re: [Qemu-devel] [Qemu-trivial] [PATCH] Fix comparisons between implicit booleans and integers.
Date: Tue, 10 Feb 2015 19:33:22 +0000	[thread overview]
Message-ID: <20150210193322.GN11603@redhat.com> (raw)
In-Reply-To: <54DA58D7.8080400@msgid.tls.msk.ru>

On Tue, Feb 10, 2015 at 10:15:35PM +0300, Michael Tokarev wrote:
> 30.01.2015 14:52, Richard W.M. Jones wrote:
> > In GCC 5 there is a new warning (-Wlogical-not-parentheses) which
> > prevents you from writing:
> > 
> >   if (<some implicitly boolean expression> == <an int>) ...
> > 
> > A typical error would be:
> > 
> > kvm-all.c: In function ‘kvm_set_migration_log’:
> > kvm-all.c:383:54: error: logical not is only applied to the left hand side of comparison [-Werror=logical-not-parentheses]
> >          if (!!(mem->flags & KVM_MEM_LOG_DIRTY_PAGES) == enable) {
> > 
> > Fix a few places where the build is now broken in GCC 5.
> > 
> > The warning isn't even consistent, as with the place in
> > hw/net/virtio-net.c where I had to cast an obviously boolean
> > expression to bool.
> 
> Richard, I'd like to apply hunks 2 and 3, but leave out hunk 1
> for now.  As a start, the hunk 1 looks a bit, well, ugly, don't
> you think?  But if I just drop hunk 1, the commit message will
> be a bit misleading, since it describes exactly the hunk1 change...

Please feel free to apply and bits and modify the commit message as
you wish.  I just want qemu to be fixed on gcc 5, I don't care how we
get there :-)

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-builder quickly builds VMs from scratch
http://libguestfs.org/virt-builder.1.html

  reply	other threads:[~2015-02-10 19:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-30 11:52 [Qemu-trivial] [PATCH] Fix comparisons between implicit booleans and integers Richard W.M. Jones
2015-01-30 11:52 ` [Qemu-devel] " Richard W.M. Jones
2015-01-30 12:13 ` [Qemu-trivial] " Paolo Bonzini
2015-01-30 12:13   ` [Qemu-devel] " Paolo Bonzini
2015-02-10 19:15 ` [Qemu-trivial] " Michael Tokarev
2015-02-10 19:15   ` [Qemu-devel] " Michael Tokarev
2015-02-10 19:33   ` Richard W.M. Jones [this message]
2015-02-10 19:33     ` Richard W.M. Jones

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=20150210193322.GN11603@redhat.com \
    --to=rjones@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=lersek@redhat.com \
    --cc=mjt@tls.msk.ru \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.