qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Bug 1926995] [NEW] hw/remote/mpqemu-link.c:221: bad error checking ?
@ 2021-05-03 18:48 dcb
  2021-05-08  4:36 ` [Bug 1926995] " Thomas Huth
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: dcb @ 2021-05-03 18:48 UTC (permalink / raw)
  To: qemu-devel

Public bug reported:

hw/remote/mpqemu-link.c:221:36: warning: logical ‘and’ of mutually
exclusive tests is always false [-Wlogical-op]

Source code is

   if (msg->cmd >= MPQEMU_CMD_MAX && msg->cmd < 0) {
        return false;
    }

Maybe better code:

   if (msg->cmd >= MPQEMU_CMD_MAX || msg->cmd < 0) {
        return false;
    }

It might be useful to switch on gcc compiler flag -Wlogical-op
to see these warnings.

** Affects: qemu
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1926995

Title:
  hw/remote/mpqemu-link.c:221: bad error checking ?

Status in QEMU:
  New

Bug description:
  hw/remote/mpqemu-link.c:221:36: warning: logical ‘and’ of mutually
  exclusive tests is always false [-Wlogical-op]

  Source code is

     if (msg->cmd >= MPQEMU_CMD_MAX && msg->cmd < 0) {
          return false;
      }

  Maybe better code:

     if (msg->cmd >= MPQEMU_CMD_MAX || msg->cmd < 0) {
          return false;
      }

  It might be useful to switch on gcc compiler flag -Wlogical-op
  to see these warnings.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1926995/+subscriptions


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-08-25  7:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-03 18:48 [Bug 1926995] [NEW] hw/remote/mpqemu-link.c:221: bad error checking ? dcb
2021-05-08  4:36 ` [Bug 1926995] " Thomas Huth
2021-05-25  7:42 ` Thomas Huth
2021-08-25  7:06 ` Thomas Huth

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).