From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54661) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUbfP-0003fm-H3 for qemu-devel@nongnu.org; Tue, 23 Apr 2013 07:45:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UUbfO-000820-8v for qemu-devel@nongnu.org; Tue, 23 Apr 2013 07:45:47 -0400 Received: from e06smtp10.uk.ibm.com ([195.75.94.106]:41845) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUbfN-00081q-JK for qemu-devel@nongnu.org; Tue, 23 Apr 2013 07:45:46 -0400 Received: from /spool/local by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 23 Apr 2013 12:44:03 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 597AF17D801C for ; Tue, 23 Apr 2013 12:46:40 +0100 (BST) Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by b06cxnps3075.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r3NBjWl952166862 for ; Tue, 23 Apr 2013 11:45:32 GMT Received: from d06av03.portsmouth.uk.ibm.com (localhost.localdomain [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r3NBjfX1012162 for ; Tue, 23 Apr 2013 05:45:42 -0600 Message-ID: <5176745D.7000007@de.ibm.com> Date: Tue, 23 Apr 2013 13:45:33 +0200 From: Christian Borntraeger MIME-Version: 1.0 References: <1366658298-9275-1-git-send-email-agraf@suse.de> <1366716185-36913-1-git-send-email-borntraeger@de.ibm.com> <1366716185-36913-4-git-send-email-borntraeger@de.ibm.com> <51767124.2060503@suse.de> In-Reply-To: <51767124.2060503@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 3/4] s390-ccw.img: Fix compile warning in s390 ccw virtio code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: cornelia.huck@de.ibm.com, qemu-devel@nongnu.org, Dominik Dingel On 23/04/13 13:31, Alexander Graf wrote: > On 04/23/2013 01:23 PM, Christian Borntraeger wrote: >> Lets fix this gcc warning: >> >> virtio.c: In function ‘vring_send_buf’: >> virtio.c:125:35: error: operation on ‘vr->next_idx’ may be undefined >> [-Werror=sequence-point] >> >> Signed-off-by: Christian Borntraeger >> --- >> pc-bios/s390-ccw/virtio.c | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) >> >> diff --git a/pc-bios/s390-ccw/virtio.c b/pc-bios/s390-ccw/virtio.c >> index 79e2941..1968fc6 100644 >> --- a/pc-bios/s390-ccw/virtio.c >> +++ b/pc-bios/s390-ccw/virtio.c >> @@ -122,7 +122,9 @@ static void vring_send_buf(struct vring *vr, void *p, int len, int flags) >> vr->desc[vr->next_idx].addr = (ulong)p; >> vr->desc[vr->next_idx].len = len; >> vr->desc[vr->next_idx].flags = flags& ~VRING_HIDDEN_IS_CHAIN; >> - vr->desc[vr->next_idx].next = ++vr->next_idx; >> + vr->desc[vr->next_idx].next = vr->next_idx; >> + vr->desc[vr->next_idx].next++; >> + vr->next_idx++; > > Hrm. This looks a lot more complicated than it needs to. Why is gcc emitting a warning here? Maybe it only wants braces. Please try whether > > .next = ++(vr->next_id); > > works for you. > > > Alex > > I already did that, but I get the same error message. I dont understand why gcc emits that warning, but it does :-(