From: Mark Vitale Date: Mon, 27 Jan 2020 01:17:40 +0000 (-0500) Subject: afs: silence bogus warning about dcListCount uninitialized X-Git-Tag: openafs-devel-1_9_0~155 X-Git-Url: http://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=09ec1073b4c5d2eb70dcf5d8063018bc82e5a35e;hp=9238b1eb9ef02889855eaade76e5b7962e5f2f28 afs: silence bogus warning about dcListCount uninitialized Commit 3be5880d1d2a0aef6600047ed43d602949cd5f4d 'afs: Avoid panics in afs_InvalidateAllSegments' is correct, but at least one compiler (gcc 4.3.4 on SLES 11.3) is fooled into issuing a warning: [...]/afs_segments.c: In function 'afs_InvalidateAllSegments_once': [...]/afs_segments.c:506: error: 'dcListCount' may be used uninitialized in this function To silence the bogus warning, initialize dcListCount when defined. Change-Id: I5938c85c71d08ed61ec1f69a50afb19c9b31fa82 Reviewed-on: https://gerrit.openafs.org/14048 Tested-by: BuildBot Reviewed-by: Mark Vitale Reviewed-by: Benjamin Kaduk --- diff --git a/src/afs/afs_segments.c b/src/afs/afs_segments.c index f720cb4..b1de015 100644 --- a/src/afs/afs_segments.c +++ b/src/afs/afs_segments.c @@ -503,7 +503,7 @@ afs_InvalidateAllSegments_once(struct vcache *avc) afs_int32 hash; afs_int32 index; struct dcache **dcList = NULL; - int i, dcListMax, dcListCount; + int i, dcListMax, dcListCount = 0; AFS_STATCNT(afs_InvalidateAllSegments); afs_Trace2(afs_iclSetp, CM_TRACE_INVALL, ICL_TYPE_POINTER, avc, @@ -539,7 +539,6 @@ afs_InvalidateAllSegments_once(struct vcache *avc) } dcList = osi_Alloc(dcListMax * sizeof(struct dcache *)); - dcListCount = 0; for (index = afs_dvhashTbl[hash]; index != NULLIDX;) { if (afs_indexUnique[index] == avc->f.fid.Fid.Unique) {