From f2eb09b089bcdf546ed3fd4c2c59d9df02c585d8 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Tue, 26 Jul 2022 16:14:50 +0200 Subject: [PATCH] Adjust function definitions in kern_resource.c to avoid clang 15 warnings With clang 15, the following -Werror warnings are produced: sys/kern/kern_resource.c:1212:10: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] lim_alloc() ^ void sys/kern/kern_resource.c:1365:11: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] uihashinit() ^ void This is because lim_alloc() and uihashinit() are declared with (void) argument lists, but defined with empty argument lists. Make the definitions match the declarations. MFC after: 3 days --- sys/kern/kern_resource.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c index 6ffd1bb379b..be81f97847d 100644 --- a/sys/kern/kern_resource.c +++ b/sys/kern/kern_resource.c @@ -1209,7 +1209,7 @@ rufetchcalc(struct proc *p, struct rusage *ru, struct timeval *up, * reference count and mutex pointer. */ struct plimit * -lim_alloc() +lim_alloc(void) { struct plimit *limp; @@ -1362,7 +1362,7 @@ lim_rlimit_proc(struct proc *p, int which, struct rlimit *rlp) } void -uihashinit() +uihashinit(void) { uihashtbl = hashinit(maxproc / 16, M_UIDINFO, &uihash);