All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: przanoni@gmail.com, intel-gfx@lists.freedesktop.org
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Subject: Re: [PATCH 1/2] Fix "always false" conditionals
Date: Fri, 16 Sep 2011 23:11:30 +0100	[thread overview]
Message-ID: <e39f63$1k2v3o@fmsmga002.fm.intel.com> (raw)
In-Reply-To: <1316209981-23217-1-git-send-email-przanoni@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1266 bytes --]

On Fri, 16 Sep 2011 18:53:01 -0300, przanoni@gmail.com wrote:
> From: Paulo Zanoni <paulo.r.zanoni@intel.com>
> 
> 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 <paulo.r.zanoni@intel.com>
> ---
>  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

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2011-09-16 22:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-16 21:53 [PATCH 1/2] Fix "always false" conditionals przanoni
2011-09-16 21:56 ` [PATCH 2/2] Remove useless assertion przanoni
2011-09-16 22:11 ` Chris Wilson [this message]
2011-09-18  8:48 ` [PATCH 1/2] Fix "always false" conditionals Chris Wilson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='e39f63$1k2v3o@fmsmga002.fm.intel.com' \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=paulo.r.zanoni@intel.com \
    --cc=przanoni@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.