Subject: Re: Another vax incompatibility: /src/sys/kern/kern_resource.c
To: None <port-vax@netbsd.org>
From: sgimips NetBSD list <sgimips@mrynet.com>
List: port-vax
Date: 05/13/2004 15:58:04
Hi,

> From: der Mouse <mouse@Rodents.Montreal.QC.CA>
> Date: 05/13/2004 13:29:15
> 
> > Just found another incompatibility with port-vax:
> 
> > Introduced on May 6 by pk@netbsd.org, rev 1.83 of
> > /src/sys/kern/kern_resource.c
> > Look like the current gcc doesn't require declarations to be at the
> > beginning of a function.
> 
> Or else the test-build was done under circumstances which caused
> simple_lock() to be a macro whose expansion is legal before
> declarations.

Well, the mod fixed things for the vax.   And now I've found another in
sys/uvm/uvm_map.c at line 3580:

        void
        uvmspace_free(struct vmspace *vm)
        {
                struct vm_map_entry *dead_entries;
                struct vm_map *map = &vm->vm_map;
                UVMHIST_FUNC("uvmspace_free"); UVMHIST_CALLED(maphist);
 
                UVMHIST_LOG(maphist,"(vm=0x%x) ref=%d", vm, vm->vm_refcnt,0,0);  
                simple_lock(&map->ref_lock);
---3580-->      int n = --vm->vm_refcnt;
                simple_unlock(&map->ref_lock);

I wonder how many more I'm going to find now.
Either code will have utilise "old-style" discipline of putting the declaration
before code, or the vax port will be broken until it gets a newer gcc.

-scott

> 
> >         simple_lock(&lim->p_slock);
> > !       int n = --lim->p_refcnt;
> > --- 535,543 ----
> > +       int n;
> >         simple_lock(&lim->p_slock);
> > !       n = --lim->p_refcnt;
> 
> /~\ The ASCII				der Mouse
> \ / Ribbon Campaign
>  X  Against HTML	       mouse@rodents.montreal.qc.ca
> / \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B
>