From owner-freebsd-current Wed Nov 4 09:57:23 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA02897 for freebsd-current-outgoing; Wed, 4 Nov 1998 09:57:23 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from whistle.com (s205m131.whistle.com [207.76.205.131]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id JAA02891 for ; Wed, 4 Nov 1998 09:57:19 -0800 (PST) (envelope-from archie@whistle.com) Received: (from smap@localhost) by whistle.com (8.7.5/8.6.12) id JAA27747; Wed, 4 Nov 1998 09:57:10 -0800 (PST) Received: from bubba.whistle.com(207.76.205.7) by whistle.com via smap (V1.3) id sma027739; Wed Nov 4 09:56:43 1998 Received: (from archie@localhost) by bubba.whistle.com (8.8.7/8.6.12) id JAA12092; Wed, 4 Nov 1998 09:56:43 -0800 (PST) From: Archie Cobbs Message-Id: <199811041756.JAA12092@bubba.whistle.com> Subject: Re: Current 'make world' warnings cleanup In-Reply-To: from Jeroen Ruigrok/Asmodai at "Nov 4, 98 09:10:25 am" To: asmodai@wxs.nl (Jeroen Ruigrok/Asmodai) Date: Wed, 4 Nov 1998 09:56:43 -0800 (PST) Cc: current@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL38 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Jeroen Ruigrok/Asmodai writes: > >> Sounds good. Just one thing: don't fall prey to the temptation to > >> fix all the pointer mismatch warnings by blindly inserting casts just > >> to make the compiler shut up. That's a common mistake, and as often > >> as not it simply hides the real problem from the compiler rather than > >> fixing it. > > > > Another gotcha when doing this.. often "unused variable" warnings > > happen because there is a variable declared that is only used > > when certain #ifdef's are true. The solution in these cases is > > not to remove the variable, but to enclose it's declaration > > within equivalent #ifdef's.. > > So in general someone forgot to put them between the appropriate definition > statements right? Either by mistake or whatever... Not sure what you mean by that.. I think so.. The point is.. depending on what #ifdef's you have, a variable may go from used to unused or vice versa. This can be avoided by having the declaration of the variable happen if-and-only-if the variable is used. Same goes for static functions in a file. -Archie ___________________________________________________________________________ Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message