-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Sunday 22 June 2003 16:07, Ishikawa wrote:
> > >
> > > (for example, the line 283 of vt.c could be re-written to
> > > int kludge_i; /* to shut up warning */
> > >
> > > if((kludge_i = tmp.kb_func) >= MAX_NR_FUNC)
> > > return -EINVAL;
> >
> > Some days ago, I've also looked over it to find a solution. :)
> > But IMHO the kludge_i is far more uglier than the warning.
> > What about that:
> >
> > if((int)tmp.kb_func >= MAX_NR_FUNC)
> > return -EINVAL;
> >
> > Doesn't it work?
>
> Unfortunately, GCC 3.3 is so clever that
> mere type casting (as you suggested) still produced warning.
> Only after assigning to an integer variable, I see
> the warning message gone. Tough luck.
> Agreed. The remedy is very ugly.
What about adding something like that:
#if MAX_NR_FUNC < 256
if((int)tmp.kb_func >= MAX_NR_FUNC)
return -EINVAL;
#endif
Sure, this is ugly, too, but I think the warning is
_very_ ugly. Another solution is, what you already
said, to completely remove this if ().
>
> Regards,
>
> Ishikawa Chiaki
- --
Regards Michael Büsch
http://www.8ung.at/tuxsoft
16:52:16 up 1:46, 1 user, load average: 1.16, 1.14, 1.06
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQE+9cQcoxoigfggmSgRAi0CAJ9kkvQfNEQ3vpSLDzPhVLhZ5qoB0gCcC+mn
DCEUHvdUN4QssLP/HaRtb2U=
=wK2z
-----END PGP SIGNATURE-----
-
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/
This archive was generated by hypermail 2b29 : Mon Jun 23 2003 - 22:00:38 EST