From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48106) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cJ0Hw-0007mG-M9 for qemu-devel@nongnu.org; Mon, 19 Dec 2016 10:55:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cJ0Ht-000251-J1 for qemu-devel@nongnu.org; Mon, 19 Dec 2016 10:55:44 -0500 Received: from indium.canonical.com ([91.189.90.7]:55352) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cJ0Ht-00024C-Ci for qemu-devel@nongnu.org; Mon, 19 Dec 2016 10:55:41 -0500 Received: from loganberry.canonical.com ([91.189.90.37]) by indium.canonical.com with esmtp (Exim 4.76 #1 (Debian)) id 1cJ0Hq-0006fQ-1v for ; Mon, 19 Dec 2016 15:55:38 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 16D592E80C8 for ; Mon, 19 Dec 2016 15:55:36 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Mon, 19 Dec 2016 15:47:52 -0000 From: dcb <1651167@bugs.launchpad.net> Reply-To: Bug 1651167 <1651167@bugs.launchpad.net> Sender: bounces@canonical.com Message-Id: <20161219154752.14563.46483.malonedeb@wampee.canonical.com> Errors-To: bounces@canonical.com Subject: [Qemu-devel] [Bug 1651167] [NEW] hw/ipmi/isa_ipmi_bt.c:283: suspect use of macro ? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Public bug reported: I just had a go at compiling qemu trunk with llvm trunk. It said: hw/ipmi/isa_ipmi_bt.c:283:31: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses] Source code is IPMI_BT_SET_HBUSY(ib->control_reg, !IPMI_BT_GET_HBUSY(ib->control_reg)); That use of ! causes trouble. The SET and GET macros are defined as: #define IPMI_BT_GET_HBUSY(d) (((d) >> IPMI_BT_HBUSY_BIT) & 0x1) #define IPMI_BT_SET_HBUSY(d, v) (d) =3D (((d) & ~IPMI_BT_HBUSY_MASK) | \ (((v & 1) << IPMI_BT_HBUSY_BIT))) I can make the compiler shut up by adding extra () in the last use of v in the SET macro, like this: #define IPMI_BT_SET_HBUSY(d, v) (d) =3D (((d) & ~IPMI_BT_HBUSY_MASK) | \ ((((v) & 1) << IPMI_BT_HBUSY_BIT))) I think this is standard good practice when using macro parameters anyway. ** 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/1651167 Title: hw/ipmi/isa_ipmi_bt.c:283: suspect use of macro ? Status in QEMU: New Bug description: I just had a go at compiling qemu trunk with llvm trunk. It said: hw/ipmi/isa_ipmi_bt.c:283:31: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not- parentheses] Source code is IPMI_BT_SET_HBUSY(ib->control_reg, !IPMI_BT_GET_HBUSY(ib->control_reg)); That use of ! causes trouble. The SET and GET macros are defined as: #define IPMI_BT_GET_HBUSY(d) (((d) >> IPMI_BT_HBUSY_BIT) & 0x1) #define IPMI_BT_SET_HBUSY(d, v) (d) =3D (((d) & ~IPMI_BT_HBUSY_MASK) |= \ (((v & 1) << IPMI_BT_HBUSY_BIT))) I can make the compiler shut up by adding extra () in the last use of v in the SET macro, like this: #define IPMI_BT_SET_HBUSY(d, v) (d) =3D (((d) & ~IPMI_BT_HBUSY_MASK) |= \ ((((v) & 1) << IPMI_BT_HBUSY_BIT))) I think this is standard good practice when using macro parameters anyway. To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1651167/+subscriptions