Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Jul 2022 18:00:29 GMT
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: a6c803048fd8 - main - Adjust function definitions in xen's control.c to avoid clang 15 warnings
Message-ID:  <202207261800.26QI0Tgb005797@gitrepo.freebsd.org>

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

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

commit a6c803048fd8d4209fb1d52cd3c455a6752109b7
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-07-26 12:11:09 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2022-07-26 17:59:55 +0000

    Adjust function definitions in xen's control.c to avoid clang 15 warnings
    
    With clang 15, the following -Werror warnings are produced:
    
        sys/dev/xen/control/control.c:188:15: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
        xctrl_poweroff()
                      ^
                       void
        sys/dev/xen/control/control.c:194:13: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
        xctrl_reboot()
                    ^
                     void
        sys/dev/xen/control/control.c:207:14: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
        xctrl_suspend()
                     ^
                      void
        sys/dev/xen/control/control.c:344:12: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
        xctrl_crash()
                   ^
                    void
    
    This is because xctrl_poweroff(), xctrl_reboot(), xctrl_suspend(), and
    xctrl_crash() are declared with (void) argument lists, but defined with
    empty argument lists. Make the definitions match the declarations.
    
    MFC after:      3 days
---
 sys/dev/xen/control/control.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/sys/dev/xen/control/control.c b/sys/dev/xen/control/control.c
index 2a539c724046..c3408b6fb58a 100644
--- a/sys/dev/xen/control/control.c
+++ b/sys/dev/xen/control/control.c
@@ -185,26 +185,26 @@ struct xctrl_softc {
 
 /*------------------------------ Event Handlers ------------------------------*/
 static void
-xctrl_poweroff()
+xctrl_poweroff(void)
 {
 	shutdown_nice(RB_POWEROFF|RB_HALT);
 }
 
 static void
-xctrl_reboot()
+xctrl_reboot(void)
 {
 	shutdown_nice(0);
 }
 
 #if !defined(__amd64__) && !defined(__i386__)
 static void
-xctrl_suspend()
+xctrl_suspend(void)
 {
 	printf("WARNING: xen/control: Suspend not supported!\n");
 }
 #else /* __amd64__ || __i386__ */
 static void
-xctrl_suspend()
+xctrl_suspend(void)
 {
 #ifdef SMP
 	cpuset_t cpu_suspend_map;
@@ -341,7 +341,7 @@ xctrl_suspend()
 #endif /* __amd64__ || __i386__ */
 
 static void
-xctrl_crash()
+xctrl_crash(void)
 {
 	panic("Xen directed crash");
 }



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