From 92a6242de2d8ea280debc283a7c089f97c1670bc Mon Sep 17 00:00:00 2001 From: Michael Meffie Date: Mon, 23 Aug 2021 15:37:13 -0400 Subject: [PATCH] bucoord: Fix doDispatch() array-parameter gcc warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The doDispatch() prototype does not match the function definition. The targv parameter is declared as an unbounded array in the prototype, but is defined as a bounded array. As of GCC 12, a warning is issued for the mismatch. main.c:346:18: error: argument 2 of type ‘char *[100]’ with mismatched bound [-Werror=array-parameter=] bucoord_internal.h:123:40: note: previously declared as ‘char *[]’ Within doDispatch(), the targv argument is just passed to cmd_Dispatch() (this is the only use of targv). Since cmd_Displatch() expects an unbounded array, update the doDispatch() definition to match the prototype. Change-Id: I50a170b3490d0d4e5d971b9ccb483cccb6833686 Reviewed-on: https://gerrit.openafs.org/14771 Reviewed-by: Michael Meffie Reviewed-by: Cheyenne Wills Tested-by: BuildBot Reviewed-by: Benjamin Kaduk --- src/bucoord/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bucoord/main.c b/src/bucoord/main.c index a453cc9dd1..972ac2d3a4 100644 --- a/src/bucoord/main.c +++ b/src/bucoord/main.c @@ -343,7 +343,7 @@ struct Lock dispatchLock; /* lock on the Dispatch call */ afs_int32 doDispatch(afs_int32 targc, - char *targv[MAXV], + char *targv[], afs_int32 dispatchCount) /* to prevent infinite recursion */ { char *sargv[MAXV];