git: f2eb09b089bc - main - Adjust function definitions in kern_resource.c to avoid clang 15 warnings
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 26 Jul 2022 18:00:37 UTC
The branch main has been updated by dim:
URL: https://cgit.FreeBSD.org/src/commit/?id=f2eb09b089bcdf546ed3fd4c2c59d9df02c585d8
commit f2eb09b089bcdf546ed3fd4c2c59d9df02c585d8
Author: Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-07-26 14:14:50 +0000
Commit: Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2022-07-26 17:59:57 +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
---
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 6ffd1bb379b2..be81f97847de 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);