public inbox for [email protected]
 help / color / mirror / Atom feed
From: Ammar Faizi <[email protected]>
To: Jens Axboe <[email protected]>
Cc: Ammar Faizi <[email protected]>,
	Pavel Begunkov <[email protected]>,
	Gilang Fachrezy <[email protected]>,
	Muhammad Rizki <[email protected]>,
	VNLX Kernel Department <[email protected]>,
	GNU/Weeb Mailing List <[email protected]>,
	io-uring Mailing List <[email protected]>
Subject: [PATCH liburing v1 3/8] tests: Fix `-Wstrict-prototypes` warnings from Clang
Date: Mon, 19 Dec 2022 22:49:55 +0700	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

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 <[email protected]>
---
 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 --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
 
-- 
Ammar Faizi


  parent reply	other threads:[~2022-12-19 15:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-19 15:49 [PATCH liburing v1 0/8] liburing updates Ammar Faizi
2022-12-19 15:49 ` [PATCH liburing v1 1/8] ffi: Add SPDX-License-Idetifier Ammar Faizi
2022-12-19 15:49 ` [PATCH liburing v1 2/8] Makefile: Add a '+' char to silence a Makefile warning Ammar Faizi
2022-12-19 15:49 ` Ammar Faizi [this message]
2022-12-19 15:49 ` [PATCH liburing v1 4/8] test/ring-leak: Remove a "break" statement in a "for loop" Ammar Faizi
2022-12-19 15:49 ` [PATCH liburing v1 5/8] tests: Fix clang `-Wunreachable-code` warning Ammar Faizi
2022-12-19 15:49 ` [PATCH liburing v1 6/8] tests: Declare internal variables as static Ammar Faizi
2022-12-19 15:49 ` [PATCH liburing v1 7/8] github: Add more extra flags for clang build Ammar Faizi
2022-12-19 15:50 ` [PATCH liburing v1 8/8] CHANGELOG: Update the CHANGELOG file Ammar Faizi
2022-12-19 17:00 ` [PATCH liburing v1 0/8] liburing updates Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox