public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@prefeitura.sp.gov.br>
To: Willy Tarreau <willy@w.ods.org>
Cc: Alex Davis <alex14641@yahoo.com>, linux-kernel@vger.kernel.org
Subject: Re: Warnings building 2.4.22rc2 with gcc 3.3
Date: 11 Aug 2003 13:59:05 -0300	[thread overview]
Message-ID: <1060621144.6452.40.camel@lorien> (raw)
In-Reply-To: <20030811155023.GB2868@alpha.home.local>

Willy,

Em Seg, 2003-08-11 às 12:50, Willy Tarreau escreveu:
> On Mon, Aug 11, 2003 at 01:54:53AM -0700, Alex Davis wrote:
> > When I build 2.4.22rc2 with gcc 3.3, I get the following warnings
> > 
> > 
> > vt.c:166: warning: comparison is always false due to limited range of data type
> > vt.c:283: warning: comparison is always false due to limited range of data type
> > keyboard.c:644: warning: comparison is always true due to limited range of data type
> > 
> > It seems an unsigned char is being compared with 256, which always returns false.
> 
> For keyboard.c, the test is :
> 
>         if (value < SIZE(func_table)) {
> 
> so it's reassuring that any value is contained in the table. We could hide
> the warning with a cast of value to (int).

 I'm getting it in 2.6.0-test3(-mm1) too. The problem (I think) is 
that the ''if'' is aways true because ''value'' never will be > than
''SIZE(func_table)''.
 
 The cast does not solve the problem, because ''value'' have just
8 bits (unsigned char) used, in other words, with the cast
the ''if'' will continue to be true.

-- 
Luiz Fernando N. Capitulino

<lcapitulino@prefeitura.sp.gov.br>
<http://www.telecentros.sp.gov.br>


  reply	other threads:[~2003-08-11 17:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-11  8:54 Warnings building 2.4.22rc2 with gcc 3.3 Alex Davis
2003-08-11 15:50 ` Willy Tarreau
2003-08-11 16:59   ` Luiz Capitulino [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-08-11 15:26 Alex Davis

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=1060621144.6452.40.camel@lorien \
    --to=lcapitulino@prefeitura.sp.gov.br \
    --cc=alex14641@yahoo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=willy@w.ods.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox