Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Jan 2002 12:18:02 -0800 (PST)
From:      Julian Elischer <julian@elischer.org>
To:        David Malone <dwmalone@maths.tcd.ie>
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:  <Pine.BSF.4.21.0201261216500.37522-100000@InterJet.elischer.org>
In-Reply-To: <20020126200150.GA21646@walton.maths.tcd.ie>

next in thread | previous in thread | raw e-mail | index | archive | help
this looks ok.. you should see similar on all the other .h files that may
be used in userland. (for a sanity check)



On Sat, 26 Jan 2002, David Malone wrote:

> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0201261216500.37522-100000>