[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/4] s390-ccw.img: Fix compile warning in s390 c
From: |
Alexander Graf |
Subject: |
Re: [Qemu-devel] [PATCH 3/4] s390-ccw.img: Fix compile warning in s390 ccw virtio code |
Date: |
Fri, 26 Apr 2013 08:38:28 +0200 |
On 23.04.2013, at 13:45, Christian Borntraeger wrote:
> 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<address@hidden>
>>> ---
>>> 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 :-(
*shrug* I'll just add it to the queue.
Alex