lkml.org 
[lkml]   [2003]   [Aug]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Warnings building 2.4.22rc2 with gcc 3.3
From
Date
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>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:47    [W:0.025 / U:0.436 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site