qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug 1926995] [NEW] hw/remote/mpqemu-link.c:221: bad error checking ?


From: dcb
Subject: [Bug 1926995] [NEW] hw/remote/mpqemu-link.c:221: bad error checking ?
Date: Mon, 03 May 2021 18:48:22 -0000

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]