Re: 2.5.73 compile warnings
From: Andries Brouwer <hidden>
Date: 2003-06-30 15:49:05
On Mon, Jun 30, 2003 at 05:13:05PM +0200, Margit Schubert-While wrote:
2.5.73 + latest cset GCC 3.3 drivers/char/vt_ioctl.c: In function `do_kdsk_ioctl': drivers/char/vt_ioctl.c:85: warning: comparison is always false due to limited range of data type drivers/char/vt_ioctl.c:85: warning: comparison is always false due to limited range of data type drivers/char/vt_ioctl.c: In function `do_kdgkb_ioctl': drivers/char/vt_ioctl.c:211: warning: comparison is always false due to limited range of data type drivers/char/keyboard.c: In function `k_fn': drivers/char/keyboard.c:665: warning: comparison is always true due to limited range of data type
These are checks of the "cannot happen" type, where "cannot happen" can be seen by the compiler, so that it can optimize the tests away. As it is now, correctness of the code can be seen locally. If the tests are removed, a human reader must look up the values of these constants to conclude that the code is correct.