From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Wilson Subject: Re: [PATCH 1/2] Fix "always false" conditionals Date: Fri, 16 Sep 2011 23:11:30 +0100 Message-ID: References: <1316209981-23217-1-git-send-email-przanoni@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0562249757==" Return-path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id B52909E810 for ; Fri, 16 Sep 2011 15:11:34 -0700 (PDT) In-Reply-To: <1316209981-23217-1-git-send-email-przanoni@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: przanoni@gmail.com, intel-gfx@lists.freedesktop.org Cc: Paulo Zanoni List-Id: intel-gfx@lists.freedesktop.org --===============0562249757== Content-Type: text/plain On Fri, 16 Sep 2011 18:53:01 -0300, przanoni@gmail.com wrote: > From: Paulo Zanoni > > Enums are unsigned by default in gcc and we can't rely on any specific > signedess for the other compilers. > > i965_render.c: In function ‘i965_prepare_composite’: > i965_render.c:2018:2: warning: comparison of unsigned expression < 0 is always false > i965_render.c:2025:2: warning: comparison of unsigned expression < 0 is always false > i965_render.c:2050:3: warning: comparison of unsigned expression < 0 is always false > i965_render.c:2057:3: warning: comparison of unsigned expression < 0 is always false > > Signed-off-by: Paulo Zanoni > --- > src/i965_render.c | 18 ++++++++++-------- > 1 files changed, 10 insertions(+), 8 deletions(-) > > I could also have defined FILTER_ERROR as -1, then gcc would have automagically > converted the enum to signed, but I'm not sure what other compilers would do in > this case. That behaviour is guarranteed by the C standard. Besides which we only have one compiler. ;-) The extra verbosity is good, but you should also fixup all the switches that use those enums (in preparation for -Wswitch-enum). -Chris -- Chris Wilson, Intel Open Source Technology Centre --===============0562249757== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx --===============0562249757==--