Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Jul 2022 18:48:42 GMT
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: b59fd9264f9e - stable/12 - Adjust function definitions in kern_cons.c to avoid clang 15 warnings
Message-ID:  <202207291848.26TImgiX025729@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by dim:

URL: https://cgit.FreeBSD.org/src/commit/?id=b59fd9264f9eb11a99b0fa4ce73fc5d75df48d37

commit b59fd9264f9eb11a99b0fa4ce73fc5d75df48d37
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:44:21 +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 e937ea7f21ca..19ee88f42cac 100644
--- a/sys/kern/kern_cons.c
+++ b/sys/kern/kern_cons.c
@@ -172,7 +172,7 @@ cninit(void)
 }
 
 void
-cninit_finish()
+cninit_finish(void)
 {
 	console_pausing = 0;
 } 
@@ -344,7 +344,7 @@ SYSCTL_PROC(_kern, OID_AUTO, console, CTLTYPE_STRING|CTLFLAG_RW,
 	0, 0, sysctl_kern_console, "A", "Console device control");
 
 void
-cngrab()
+cngrab(void)
 {
 	struct cn_device *cnd;
 	struct consdev *cn;
@@ -357,7 +357,7 @@ cngrab()
 }
 
 void
-cnungrab()
+cnungrab(void)
 {
 	struct cn_device *cnd;
 	struct consdev *cn;
@@ -370,7 +370,7 @@ cnungrab()
 }
 
 void
-cnresume()
+cnresume(void)
 {
 	struct cn_device *cnd;
 	struct consdev *cn;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202207291848.26TImgiX025729>