diff mbox series

[liburing,v1,3/8] tests: Fix `-Wstrict-prototypes` warnings from Clang

Message ID 20221219155000.2412524-4-ammar.faizi@intel.com (mailing list archive)
State New
Headers show
Series liburing updates | expand

Commit Message

Ammar Faizi Dec. 19, 2022, 3:49 p.m. UTC
This is a preparation patch to integrate -Wstrict-prototypes flag to
the GitHub CI robot. Clang says:

  warning: a function declaration without a prototype is \
  deprecated in all versions of C [-Wstrict-prototypes]

Make sure we put "void" in the argument list of the function
declaration if the function doesn't accept any argument.

Reproducer (with clang-16):

  ./configure --cc=clang --cxx=clang++;
  CFLAGS="-Wall -Wextra -Wstrict-prototypes" make -j8;

Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org>
---
 test/35fa71a030ca.c        | 2 +-
 test/a4c0b3decb33.c        | 2 +-
 test/accept.c              | 2 +-
 test/fc2a85cb02ef.c        | 2 +-
 test/pollfree.c            | 2 +-
 test/sqpoll-disable-exit.c | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/test/35fa71a030ca.c b/test/35fa71a030ca.c
index fc1a419..5540d8d 100644
--- a/test/35fa71a030ca.c
+++ b/test/35fa71a030ca.c
@@ -169,21 +169,21 @@  static void kill_and_wait(int pid, int* status)
       close(fd);
     }
     closedir(dir);
   } else {
   }
   while (waitpid(-1, status, __WALL) != pid) {
   }
 }
 
 #define SYZ_HAVE_SETUP_TEST 1
-static void setup_test()
+static void setup_test(void)
 {
   prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0);
   setpgrp();
   write_file("/proc/self/oom_score_adj", "1000");
 }
 
 struct thread_t {
   int created, call;
   event_t ready, done;
 };
diff --git a/test/a4c0b3decb33.c b/test/a4c0b3decb33.c
index eb9587c..626f60a 100644
--- a/test/a4c0b3decb33.c
+++ b/test/a4c0b3decb33.c
@@ -88,21 +88,21 @@  static void kill_and_wait(int pid, int* status)
 			}
 			close(fd);
 		}
 		closedir(dir);
 	} else {
 	}
 	while (waitpid(-1, status, __WALL) != pid) {
 	}
 }
 
-static void setup_test()
+static void setup_test(void)
 {
 	prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0);
 	setpgrp();
 	write_file("/proc/self/oom_score_adj", "1000");
 }
 
 static void execute_one(void);
 
 #define WAIT_FLAGS __WALL
 
diff --git a/test/accept.c b/test/accept.c
index 1821faa..61737fa 100644
--- a/test/accept.c
+++ b/test/accept.c
@@ -604,21 +604,21 @@  static int test_multishot_accept(int count, bool before, bool overflow)
 	if (no_accept_multi)
 		return T_EXIT_SKIP;
 
 	ret = io_uring_queue_init(MAX_FDS + 10, &m_io_uring, 0);
 	assert(ret >= 0);
 	ret = test(&m_io_uring, args);
 	io_uring_queue_exit(&m_io_uring);
 	return ret;
 }
 
-static int test_accept_multishot_wrong_arg()
+static int test_accept_multishot_wrong_arg(void)
 {
 	struct io_uring m_io_uring;
 	struct io_uring_cqe *cqe;
 	struct io_uring_sqe *sqe;
 	int fd, ret;
 
 	ret = io_uring_queue_init(4, &m_io_uring, 0);
 	assert(ret >= 0);
 
 	fd = start_accept_listen(NULL, 0, 0);
diff --git a/test/fc2a85cb02ef.c b/test/fc2a85cb02ef.c
index 6fd5fd8..c828f67 100644
--- a/test/fc2a85cb02ef.c
+++ b/test/fc2a85cb02ef.c
@@ -47,21 +47,21 @@  static int inject_fault(int nth)
   fd = open("/proc/thread-self/fail-nth", O_RDWR);
   if (fd == -1)
     exit(1);
   char buf[16];
   sprintf(buf, "%d", nth + 1);
   if (write(fd, buf, strlen(buf)) != (ssize_t)strlen(buf))
     exit(1);
   return fd;
 }
 
-static int setup_fault()
+static int setup_fault(void)
 {
   static struct {
     const char* file;
     const char* val;
     bool fatal;
   } files[] = {
       {"/sys/kernel/debug/failslab/ignore-gfp-wait", "N", true},
       {"/sys/kernel/debug/failslab/verbose", "0", false},
       {"/sys/kernel/debug/fail_futex/ignore-private", "N", false},
       {"/sys/kernel/debug/fail_page_alloc/verbose", "0", false},
diff --git a/test/pollfree.c b/test/pollfree.c
index d753ffe..ebd88b1 100644
--- a/test/pollfree.c
+++ b/test/pollfree.c
@@ -245,21 +245,21 @@  static void kill_and_wait(int pid, int* status)
       }
       close(fd);
     }
     closedir(dir);
   } else {
   }
   while (waitpid(-1, status, __WALL) != pid) {
   }
 }
 
-static void setup_test()
+static void setup_test(void)
 {
   prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0);
   setpgrp();
 }
 
 struct thread_t {
   int created, call;
   event_t ready, done;
 };
 
diff --git a/test/sqpoll-disable-exit.c b/test/sqpoll-disable-exit.c
index 76b6cf5..5283702 100644
--- a/test/sqpoll-disable-exit.c
+++ b/test/sqpoll-disable-exit.c
@@ -129,21 +129,21 @@  static void kill_and_wait(int pid, int* status)
       }
       close(fd);
     }
     closedir(dir);
   } else {
   }
   while (waitpid(-1, status, __WALL) != pid) {
   }
 }
 
-static void setup_test()
+static void setup_test(void)
 {
   prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0);
   setpgrp();
   write_file("/proc/self/oom_score_adj", "1000");
 }
 
 static void execute_one(void);
 
 #define WAIT_FLAGS __WALL