pc-bios/s390-ccw/libc: size_t should be unsigned

Bug #1753437 reported by dcb
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QEMU
Fix Released
Low
Thomas Huth

Bug Description

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.

Revision history for this message
Christian Borntraeger (borntraeger) wrote : Re: [Qemu-devel] [Bug 1753437] [NEW] qemu/pc-bios/s390-ccw/libc.c:82: bad test ?

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.
>
> ** Affects: qemu
> Importance: Undecided
> Status: New
>

Revision history for this message
Thomas Huth (th-huth) wrote : Re: qemu/pc-bios/s390-ccw/libc.c:82: bad test ?

Looks like the mailing list <-> launchpad bridge again ignored mails to the corresponding mailing list thread. It's not a real bug, see here for details:
https://lists.gnu.org/archive/html/qemu-devel/2018-03/msg01142.html
I'll try to remember to clean this up the next time we update the s390-ccw bios.

Changed in qemu:
assignee: nobody → Thomas Huth (th-huth)
Thomas Huth (th-huth)
Changed in qemu:
importance: Undecided → Low
status: New → Confirmed
Thomas Huth (th-huth)
summary: - qemu/pc-bios/s390-ccw/libc.c:82: bad test ?
+ pc-bios/s390-ccw/libc: size_t should be unsigned
Revision history for this message
Thomas Huth (th-huth) wrote :
Changed in qemu:
status: Confirmed → Fix Committed
Thomas Huth (th-huth)
Changed in qemu:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.