git: 4f52b2ba472e - stable/12 - 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:48:29 UTC
The branch stable/12 has been updated by dim:
URL: https://cgit.FreeBSD.org/src/commit/?id=4f52b2ba472ed357b9a49a7d5ae382c5d1a0c781
commit 4f52b2ba472ed357b9a49a7d5ae382c5d1a0c781
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:36:11 +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 f0845a5c1a54..2c264dd9e289 100644
--- a/sys/kern/kern_resource.c
+++ b/sys/kern/kern_resource.c
@@ -1179,7 +1179,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;
@@ -1304,7 +1304,7 @@ lim_rlimit_proc(struct proc *p, int which, struct rlimit *rlp)
}
void
-uihashinit()
+uihashinit(void)
{
uihashtbl = hashinit(maxproc / 16, M_UIDINFO, &uihash);