[OpenAFS-devel] Bug in 1.3.85 - static declaration of freeVCList

Zach Schimke zschimke@mars.asu.edu
Tue, 12 Jul 2005 10:09:33 -0700


--=-pMibrS8sNKpMoTRFJ/VU
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Guys,

	Found a bug that stops compilation in 1.3.85. Is 'freeVCList' and
'Initial_freeVCList' supposed to be static declarations or not? They're
listed as static in src/afs/afs_vcache.c:67 but not in
src/afs/afs_prototypes.h:817. I'm not a programmer but something doesn't
mesh well here. Anyone like to double check me? 

	The nonstatic.patch works well, but the static patch dies. This might
be a GCC 4.0 problem? 

-- 
Zach Schimke <zschimke@mars.asu.edu>
Junior Systems Administrator
Mars Space Flight Facility

--=-pMibrS8sNKpMoTRFJ/VU
Content-Disposition: attachment; filename=nonstatic.patch
Content-Type: text/x-patch; name=nonstatic.patch; charset=
Content-Transfer-Encoding: 7bit

diff -ur openafs-1.3.85/src/afs/afs_vcache.c openafs-1.3.85-patched/src/afs/afs_vcache.c
--- openafs-1.3.85/src/afs/afs_vcache.c	2005-07-11 12:29:55.000000000 -0700
+++ openafs-1.3.85-patched/src/afs/afs_vcache.c	2005-07-12 10:01:08.000000000 -0700
@@ -64,8 +64,8 @@
 afs_rwlock_t afs_xvcache;	/*Lock: alloc new stat cache entries */
 afs_lock_t afs_xvcb;		/*Lock: fids on which there are callbacks */
 #if !defined(AFS_LINUX22_ENV)
-static struct vcache *freeVCList;	/*Free list for stat cache entries */
-static struct vcache *Initial_freeVCList;	/*Initial list for above */
+struct vcache *freeVCList;	/*Free list for stat cache entries */
+struct vcache *Initial_freeVCList;	/*Initial list for above */
 #endif
 struct afs_q VLRU;		/*vcache LRU */
 afs_int32 vcachegen = 0;

--=-pMibrS8sNKpMoTRFJ/VU
Content-Disposition: attachment; filename=static.patch
Content-Type: text/x-patch; name=static.patch; charset=
Content-Transfer-Encoding: 7bit

diff -ur openafs-1.3.85/src/afs/afs_prototypes.h openafs-1.3.85-patched/src/afs/afs_prototypes.h
--- openafs-1.3.85/src/afs/afs_prototypes.h	2005-07-11 12:29:55.000000000 -0700
+++ openafs-1.3.85-patched/src/afs/afs_prototypes.h	2005-07-12 10:00:13.000000000 -0700
@@ -814,8 +814,8 @@
 extern int afsvnumbers;
 extern afs_rwlock_t afs_xvcache;
 extern afs_lock_t afs_xvcb;
-extern struct vcache *freeVCList;
-extern struct vcache *Initial_freeVCList;
+extern static struct vcache *freeVCList;
+extern static struct vcache *Initial_freeVCList;
 extern struct afs_q VLRU;
 extern afs_int32 vcachegen;
 extern unsigned int afs_paniconwarn;

--=-pMibrS8sNKpMoTRFJ/VU--