git: ac3153434fcc - main - Adjust function definitions in geom_event.c to avoid clang 15 warnings
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 26 Jul 2022 18:00:31 UTC
The branch main has been updated by dim:
URL: https://cgit.FreeBSD.org/src/commit/?id=ac3153434fcc3ddcbb47c7f397a1bc34fd0e0dcb
commit ac3153434fcc3ddcbb47c7f397a1bc34fd0e0dcb
Author: Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-07-26 13:58:31 +0000
Commit: Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2022-07-26 17:59:56 +0000
Adjust function definitions in geom_event.c to avoid clang 15 warnings
With clang 15, the following -Werror warnings are produced:
sys/geom/geom_event.c:261:13: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
g_run_events()
^
void
sys/geom/geom_event.c:405:12: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
g_do_wither()
^
void
sys/geom/geom_event.c:449:13: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
g_event_init()
^
void
This is because g_run_events(), g_do_wither(), and g_event_init() are
declared with (void) argument lists, but defined with empty argument
lists. Make the definitions match the declarations.
MFC after: 3 days
---
sys/geom/geom_event.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sys/geom/geom_event.c b/sys/geom/geom_event.c
index 359c7c984f07..cecd7fe349f6 100644
--- a/sys/geom/geom_event.c
+++ b/sys/geom/geom_event.c
@@ -258,7 +258,7 @@ one_event(void)
}
void
-g_run_events()
+g_run_events(void)
{
for (;;) {
@@ -402,7 +402,7 @@ g_post_event(g_event_t *func, void *arg, int flag, ...)
}
void
-g_do_wither()
+g_do_wither(void)
{
mtx_lock(&g_eventlock);
@@ -446,7 +446,7 @@ g_waitfor_event(g_event_t *func, void *arg, int flag, ...)
}
void
-g_event_init()
+g_event_init(void)
{
mtx_init(&g_eventlock, "GEOM orphanage", NULL, MTX_DEF);