qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] fix unsigned comparison warning in TCG
@ 2010-09-26 17:40 Hollis Blanchard
  2010-09-26 18:33 ` Blue Swirl
  0 siblings, 1 reply; 10+ messages in thread
From: Hollis Blanchard @ 2010-09-26 17:40 UTC (permalink / raw)
  To: qemu-devel

TCGOpcode is an enum, which apparently can be unsigned.

Signed-off-by: Hollis Blanchard <hollis@penguinppc.org>
---

% ./configure --target-list=ppcemb-softmmu --enable-debug
% make
  ...
  CC    ppcemb-softmmu/tcg/tcg.o
cc1: warnings being treated as errors
/home/hollisb/source/qemu.git/tcg/tcg.c: In function
‘tcg_add_target_add_op_defs’:
/home/hollisb/source/qemu.git/tcg/tcg.c:1030: error: comparison of
unsigned expression >= 0 is always true
% gcc -v
gcc version 4.4.4 20100630 (Red Hat 4.4.4-10) (GCC)

diff --git a/tcg/tcg.c b/tcg/tcg.c
index e0a9030..7e96859 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -1027,7 +1027,7 @@ void tcg_add_target_add_op_defs(const TCGTargetOpDef *tdef
         if (tdefs->op == (TCGOpcode)-1)
             break;
         op = tdefs->op;
-        assert(op >= 0 && op < NB_OPS);
+        assert(op < NB_OPS);
         def = &tcg_op_defs[op];
 #if defined(CONFIG_DEBUG_TCG)
         /* Duplicate entry in op definitions? */

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-10-20 20:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-26 17:40 [Qemu-devel] fix unsigned comparison warning in TCG Hollis Blanchard
2010-09-26 18:33 ` Blue Swirl
2010-10-07 23:15   ` Venkateswararao Jujjuri (JV)
2010-10-08  8:32   ` [Qemu-devel] [PATCH] tcg: Fix compiler error (comparison of unsigned expression) Stefan Weil
2010-10-08 16:57     ` [Qemu-devel] " Hollis Blanchard
2010-10-08 21:43       ` Stefan Weil
2010-10-13 18:58         ` Stefan Weil
2010-10-13 19:22           ` Hollis Blanchard
2010-10-13 19:33             ` Blue Swirl
2010-10-20 20:56     ` Blue Swirl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).