bucoord: Fix doDispatch() array-parameter gcc warning

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 <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
This commit is contained in:
Michael Meffie 2021-08-23 15:37:13 -04:00 committed by Benjamin Kaduk
parent b0cafad62a
commit 92a6242de2

View File

@ -343,7 +343,7 @@ struct Lock dispatchLock; /* lock on the Dispatch call */
afs_int32 afs_int32
doDispatch(afs_int32 targc, doDispatch(afs_int32 targc,
char *targv[MAXV], char *targv[],
afs_int32 dispatchCount) /* to prevent infinite recursion */ afs_int32 dispatchCount) /* to prevent infinite recursion */
{ {
char *sargv[MAXV]; char *sargv[MAXV];