Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S263765AbTFVOpG (ORCPT ); Sun, 22 Jun 2003 10:45:06 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S263866AbTFVOpG (ORCPT ); Sun, 22 Jun 2003 10:45:06 -0400 Received: from smtp018.mail.yahoo.com ([216.136.174.115]:10512 "HELO smtp018.mail.yahoo.com") by vger.kernel.org with SMTP id S263765AbTFVOpB convert rfc822-to-8bit (ORCPT ); Sun, 22 Jun 2003 10:45:01 -0400 From: Michael Buesch To: Ishikawa Subject: Re: Warning messages during compilation of 2.4.21. (5 files) Date: Sun, 22 Jun 2003 16:58:26 +0200 User-Agent: KMail/1.5.2 References: <3EF4B98D.33A55CD1@yk.rim.or.jp> <200306221343.26884.fsdeveloper@yahoo.de> <3EF5B80C.7F5340F7@yk.rim.or.jp> In-Reply-To: <3EF5B80C.7F5340F7@yk.rim.or.jp> Cc: linux kernel mailing list MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT Content-Description: clearsigned data Content-Disposition: inline Message-Id: <200306221658.36409.fsdeveloper@yahoo.de> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1640 Lines: 59 -----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/