Re: [PATCH] Remove pointless <0 comparison for unsigned variable infs/fcntl.c

From: Jesper Juhl
Date: Tue Nov 23 2004 - 18:17:54 EST


On Tue, 23 Nov 2004, Timur Tabi wrote:

> Jesper Juhl wrote:
>
> > if pid_t is 16 bit, then the value can never be greater than 0xffff but, if
> > pid_t is greater than 16 bit, say 32 bit, then the argument "a" could very
> > well contain a value greater than 0xffff and then the comparison makes
> > perfect sense.
>
> If pid_t is 32-bit, then what's wrong with the value being greater than
> 0xFFFF? After all, if pid_t a 32-bit number, that implies that 32-bit values
> are acceptable.
>
My understanding of it is that it was just an example of how code that
generated warnings about limited range of datatype could actually be
perfectly fine.


--
Jesper Juhl

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