From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49262) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSsMn-0000B0-QX for qemu-devel@nongnu.org; Mon, 08 Feb 2016 15:25:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aSsMk-0003PY-LO for qemu-devel@nongnu.org; Mon, 08 Feb 2016 15:25:01 -0500 Received: from mail-qg0-x231.google.com ([2607:f8b0:400d:c04::231]:36691) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSsMk-0003PU-GC for qemu-devel@nongnu.org; Mon, 08 Feb 2016 15:24:58 -0500 Received: by mail-qg0-x231.google.com with SMTP id y9so121913925qgd.3 for ; Mon, 08 Feb 2016 12:24:57 -0800 (PST) Sender: Richard Henderson References: <1454717370-17516-1-git-send-email-rth@twiddle.net> From: Richard Henderson Message-ID: <56B8F994.9010904@twiddle.net> Date: Tue, 9 Feb 2016 07:24:52 +1100 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PULL 00/12] TCG patch queue List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers 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~