git: 4915e4fa3526 - stable/13 - Adjust function definitions in kern_resource.c to avoid clang 15 warnings
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 29 Jul 2022 18:47:22 UTC
The branch stable/13 has been updated by dim:
URL: https://cgit.FreeBSD.org/src/commit/?id=4915e4fa35262b82bec55189d96d016788995e20
commit 4915e4fa35262b82bec55189d96d016788995e20
Author: Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-07-26 14:14:50 +0000
Commit: Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2022-07-29 18:29:08 +0000
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
(cherry picked from commit f2eb09b089bcdf546ed3fd4c2c59d9df02c585d8)
---
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 a0b2438acec5..02be770d8cd7 100644
--- a/sys/kern/kern_resource.c
+++ b/sys/kern/kern_resource.c
@@ -1199,7 +1199,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;
@@ -1332,7 +1332,7 @@ lim_rlimit_proc(struct proc *p, int which, struct rlimit *rlp)
}
void
-uihashinit()
+uihashinit(void)
{
uihashtbl = hashinit(maxproc / 16, M_UIDINFO, &uihash);