git: 5278592355a2 - stable/13 - Adjust function definitions in kern_cons.c to avoid clang 15 warnings
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 29 Jul 2022 18:47:37 UTC
The branch stable/13 has been updated by dim:
URL: https://cgit.FreeBSD.org/src/commit/?id=5278592355a28b4b0b4f3b07701b6312a5562f0e
commit 5278592355a28b4b0b4f3b07701b6312a5562f0e
Author: Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-07-26 14:03:35 +0000
Commit: Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2022-07-29 18:30:00 +0000
Adjust function definitions in kern_cons.c to avoid clang 15 warnings
With clang 15, the following -Werror warnings are produced:
sys/kern/kern_cons.c:201:14: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
cninit_finish()
^
void
sys/kern/kern_cons.c:376:7: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
cngrab()
^
void
sys/kern/kern_cons.c:389:9: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
cnungrab()
^
void
sys/kern/kern_cons.c:402:9: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
cnresume()
^
void
This is because cninit_finish(), cngrab(), cnungrab(), and cnresume()
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 9806e82a23924f32dc5976bc8687fbbe293a140b)
---
sys/kern/kern_cons.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/sys/kern/kern_cons.c b/sys/kern/kern_cons.c
index d33811f1e3c8..acb45c7de2e1 100644
--- a/sys/kern/kern_cons.c
+++ b/sys/kern/kern_cons.c
@@ -198,7 +198,7 @@ cninit(void)
}
void
-cninit_finish()
+cninit_finish(void)
{
console_pausing = 0;
}
@@ -372,7 +372,7 @@ SYSCTL_PROC(_kern, OID_AUTO, console,
"Console device control");
void
-cngrab()
+cngrab(void)
{
struct cn_device *cnd;
struct consdev *cn;
@@ -385,7 +385,7 @@ cngrab()
}
void
-cnungrab()
+cnungrab(void)
{
struct cn_device *cnd;
struct consdev *cn;
@@ -398,7 +398,7 @@ cnungrab()
}
void
-cnresume()
+cnresume(void)
{
struct cn_device *cnd;
struct consdev *cn;