qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PULL 00/12] TCG patch queue


From: Richard Henderson
Subject: Re: [Qemu-devel] [PULL 00/12] TCG patch queue
Date: Tue, 9 Feb 2016 07:24:52 +1100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0

On 02/08/2016 10:25 PM, Peter Maydell wrote:
Hi. This doesn't compile with clang, I'm afraid:

/home/petmay01/linaro/qemu-for-merges/tcg/tcg.c:2048:30: error:
comparison of constant 16 with expression of type 'TCGReg' is always
true [-Werror,-Wtautological-constant-out-of-range-compare]
             for(reg = 0; reg < TCG_TARGET_NB_REGS; reg++) {
                          ~~~ ^ ~~~~~~~~~~~~~~~~~~

Good grief. This is C, not C++. In C it isn't legal to reduce the width of the underlying type of the enum to the minimum width that contains the enumerators -- the underlying type must still be int or unsigned int. Thus reg must be able to hold the value 16 (or 1000 for that matter).

IMO this is a clang bug.

I guess I'll rearrange this code so that it doesn't use the enum in the loop.


r~



reply via email to

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