From owner-cvs-all Sat Jan 26 12: 2: 4 2002 Delivered-To: cvs-all@freebsd.org Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [134.226.81.11]) by hub.freebsd.org (Postfix) with SMTP id A223637B404; Sat, 26 Jan 2002 12:01:51 -0800 (PST) Received: from walton.maths.tcd.ie by salmon.maths.tcd.ie with SMTP id ; 26 Jan 2002 20:01:51 +0000 (GMT) Date: Sat, 26 Jan 2002 20:01:50 +0000 From: David Malone To: Julian Elischer Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org, dillon@FreeBSD.org, jake@FreeBSD.org Subject: Re: cvs commit: src/sys/vm vm.h Message-ID: <20020126200150.GA21646@walton.maths.tcd.ie> References: <200201261252.aa17054@salmon.maths.tcd.ie> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.25i Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sat, Jan 26, 2002 at 11:13:01AM -0800, Julian Elischer wrote: > > OK, but I think something in userland sees this declaration and gcc > > whines about it. I might have made the change originally when I was > > playing with WARNS and gcc3. Should this declaration be protected > > by a #ifdef _KERNEL? > All in-kernel prototypes should be invisible to userland. OK - How does the patch below look? > > I can go an dig up what produced the warning if you think that I > > would be better fixing it some other way. Here's the warning for what it's worth. I get it the usual version of gcc when I turn WARNS up on killall. I guess it means there are two problems - parameter name shadowing a global and kernel declarations visable in userland. Maybe Matt or Jake can suggest a better name for the parameter if people want to leave the parameter with a name. David. ===> usr.bin/killall cc -nostdinc -O -pipe -I/usr/obj/usr/src/i386/usr/include -Werror -Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wno-uninitialized -c /usr/src/usr.bin/killall/killall.c cc1: warnings being treated as errors In file included from /usr/obj/usr/src/i386/usr/include/sys/user.h:51, from /usr/src/usr.bin/killall/killall.c:33: /usr/obj/usr/src/i386/usr/include/vm/vm.h:130: warning: declaration of `kmi' shadows global declaration *** Error code 1 Index: sys/vm/vm.h =================================================================== RCS file: /cvs/FreeBSD-CVS/src/sys/vm/vm.h,v retrieving revision 1.19 diff -u -r1.19 vm.h --- sys/vm/vm.h 22 Aug 2001 04:07:27 -0000 1.19 +++ sys/vm/vm.h 26 Jan 2002 19:55:35 -0000 @@ -126,8 +126,10 @@ vm_offset_t pager_eva; }; +#ifdef _KERNEL extern struct kva_md_info kmi; -extern void vm_ksubmap_init(struct kva_md_info *kmi); +extern void vm_ksubmap_init(struct kva_md_info *); +#endif /* _KERNEL */ #endif /* VM_H */ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message