[libvirt] [PATCH 5/6] Enable use of -Wold-style-definition compiler flag

Daniel P. Berrange berrange at redhat.com
Mon Apr 4 16:20:03 UTC 2011


A couple of functions were declared using the old style foo()
for no-parameters, instead of foo(void)

* src/xen/xen_hypervisor.c, tests/testutils.c: Replace () with (void)
  in some function declarations
* m4/virt-compile-warnings.m4: Enable -Wold-style-definition
---
 m4/virt-compile-warnings.m4 |    1 -
 src/xen/xen_hypervisor.c    |    2 +-
 tests/testutils.c           |    4 ++--
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/m4/virt-compile-warnings.m4 b/m4/virt-compile-warnings.m4
index 9643419..24710e6 100644
--- a/m4/virt-compile-warnings.m4
+++ b/m4/virt-compile-warnings.m4
@@ -44,7 +44,6 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[
         dontwarn="$dontwarn -Wcast-qual"
         dontwarn="$dontwarn -Wconversion"
         dontwarn="$dontwarn -Wsign-conversion"
-        dontwarn="$dontwarn -Wold-style-definition"
         dontwarn="$dontwarn -Wpacked"
         dontwarn="$dontwarn -Wunused-macros"
         dontwarn="$dontwarn -Woverlength-strings"
diff --git a/src/xen/xen_hypervisor.c b/src/xen/xen_hypervisor.c
index 47355ce..8a9dae5 100644
--- a/src/xen/xen_hypervisor.c
+++ b/src/xen/xen_hypervisor.c
@@ -3621,7 +3621,7 @@ xenHypervisorGetVcpuMax(virDomainPtr domain)
  * Return true if the current process should be able to connect to Xen.
  */
 int
-xenHavePrivilege()
+xenHavePrivilege(void)
 {
 #ifdef __sun
     return priv_ineffect (PRIV_XVM_CONTROL);
diff --git a/tests/testutils.c b/tests/testutils.c
index 0ce3c7b..1f3b569 100644
--- a/tests/testutils.c
+++ b/tests/testutils.c
@@ -457,14 +457,14 @@ virTestGetFlag(const char *name) {
 }
 
 unsigned int
-virTestGetDebug() {
+virTestGetDebug(void) {
     if (testDebug == -1)
         testDebug = virTestGetFlag("VIR_TEST_DEBUG");
     return testDebug;
 }
 
 unsigned int
-virTestGetVerbose() {
+virTestGetVerbose(void) {
     if (testVerbose == -1)
         testVerbose = virTestGetFlag("VIR_TEST_VERBOSE");
     return testVerbose || virTestGetDebug();
-- 
1.7.4




More information about the libvir-list mailing list