qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [Bug 1753437] [NEW] qemu/pc-bios/s390-ccw/libc.c:82: ba


From: Thomas Huth
Subject: Re: [Qemu-devel] [Bug 1753437] [NEW] qemu/pc-bios/s390-ccw/libc.c:82: bad test ?
Date: Mon, 5 Mar 2018 15:53:21 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 05.03.2018 12:22, Christian Borntraeger wrote:
> Adding qemu-s390x.
> 
> On 03/05/2018 11:31 AM, dcb wrote:
>> Public bug reported:
>>
>> qemu/pc-bios/s390-ccw/libc.c:82]: (style) Unsigned variable 'num_idx'
>> can't be negative so it is unnecessary to test it.
>>
>> Source code is
>>
>>
>>     while (num_idx >= 0) {
>>
>> but
>>
>>     size_t num_idx = 1; /* account for NUL */
>>
>> So there is no escape from the while loop.

Actually we're defining size_t like this in the s390-ccw bios:

typedef long               size_t;

So the while loop is not endless.

But yes, this is ugly, we should fix the function and re-define size_t
to be unsigned instead...

 Thomas



reply via email to

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