From patchwork Thu Dec 13 12:45:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Avoid -Wsign-compare warning Date: Thu, 13 Dec 2012 02:45:38 -0000 From: Jakub Jelinek X-Patchwork-Id: 205824 Message-Id: <20121213124538.GR2315@tucnak.redhat.com> To: gcc-patches@gcc.gnu.org Hi! I keep seeing a -Wsign-compare warning from GCC 4.7 here, alloc_count is const int = 16, but length () method returns unsigned. Perhaps GCC 4.8 folds it to 16 early enough for the -Wsign-compare warning (might be related to the sizeof changes), but still I think it doesn't hurt to fix this up. Changing alloc_count to unsigned would leave to other -Wsign-compare warnings, because i is signed, ... Ok for trunk? 2012-12-13 Jakub Jelinek * tree-ssa-threadedge.c (propagate_threaded_block_debug_into): Avoid -Wsign-compare warning. Jakub --- gcc/tree-ssa-threadedge.c (revision 194469) +++ gcc/tree-ssa-threadedge.c (working copy) @@ -713,7 +713,7 @@ propagate_threaded_block_debug_into (bas if (i >= 0) continue; - if (fewvars.length () < alloc_count) + if (fewvars.length () < (unsigned) alloc_count) fewvars.quick_push (var); else {