DARWIN: Declare/include functions before using them 44/14744/11
authorMarcio Barbosa <mbarbosa@sinenomine.net>
Wed, 23 Mar 2022 20:58:41 +0000 (17:58 -0300)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 13 May 2022 06:38:14 +0000 (02:38 -0400)
commitf9c96d0fd609e14fcb8ff7d9269024e026f742cb
tree7658183d63c21a3806e6fbf086603dca710bc1e4
parent981b3d723ec56dad553be570147d1b2aa632f4e1
DARWIN: Declare/include functions before using them

Every function should be explicitly declared before it can be called.
Since -Wimplicit-function-declaration is usually a warning and not an
error, calling undeclared functions does not prevent us from building
the code.

However, apple-clang 12 makes this an error by default, prohibiting the
build of the current version on macOS 11 (Big Sur).

To fix this problem, declare functions before calling them. Also,
include mach/thread_act.h into afs_call.c so the declaration of
thread_terminate() can be found on macOS. Last, given that the third
argument of PIOCTL() (if UKERNEL is defined) is a pointer, cast it to
'long'. Doing so, we can avoid another inhibited warning. Notice that
this PIOCTL definition is scoped to a single file (src/auth/ktc.c).

Change-Id: I6d796c10ea4dd81b13ae5feb9f42608aa445560d
Reviewed-on: https://gerrit.openafs.org/14744
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
12 files changed:
CODING
src/afs/UKERNEL/afs_usrops.c
src/afs/UKERNEL/afs_usrops.h
src/afs/UKERNEL/afsd_uafs.c
src/afs/afs_call.c
src/afs/afs_prototypes.h
src/auth/ktc.c
src/libafs/MakefileProto.DARWIN.in
src/libuafs/Makefile.common.in
src/rx/DARWIN/rx_kmutex.c
src/rx/DARWIN/rx_kmutex.h
src/rx/rx_prototypes.h