File bsc1247420_02-fix-for-gcc15-s-feature-regarding-function-declarati.patch of Package ocfs2-test

From 7853b1ea4eaa5f9b513df35ba3a2d640b00c1603 Mon Sep 17 00:00:00 2001
From: Heming Zhao <heming.zhao@suse.com>
Date: Thu, 31 Jul 2025 13:53:36 +0800
Subject: [PATCH] fix for gcc15's feature regarding function declarations
 without parameters
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

```
inline-data.c: In function ‘concurrent_rw_test’:
inline-data.c:343:24: error: passing argument 2 of ‘signal’ from incompatible pointer type [-Wincompatible-pointer-types]
  343 |         signal(SIGINT, sigint_handler);
      |                        ^~~~~~~~~~~~~~
      |                        |
      |                        void (*)(void)
In file included from /usr/include/sys/wait.h:36,
                 from inline-data.c:65:
/usr/include/signal.h:88:57: note: expected ‘__sighandler_t’ {aka ‘void (*)(int)’} but argument is of type ‘void (*)(void)’
   88 | extern __sighandler_t signal (int __sig, __sighandler_t __handler)
      |                                          ~~~~~~~~~~~~~~~^~~~~~~~~
inline-data.c:272:13: note: ‘sigint_handler’ declared here
  272 | static void sigint_handler()
      |             ^~~~~~~~~~~~~~
/usr/include/signal.h:72:16: note: ‘__sighandler_t’ declared here
   72 | typedef void (*__sighandler_t) (int);
      |                ^~~~~~~~~~~~~~
```

Following is copied from "https://gcc.gnu.org/gcc-15/porting_to.html#c23"

> In C17 and earlier, such function declarators specified no information
> about the number or types of the parameters of the function (C17 6.7.6.3),
> requiring users to know the correct number of arguments, with each
> passed argument going through default argument promotion.

> In C23 such declarations mean (void) i.e. a function taking no arguments,
> which can lead to build failures on code that relied on the earlier meaning

Signed-off-by: Heming Zhao <heming.zhao@suse.com>
---
 programs/directio_test/directio_test.c    | 6 +++---
 programs/discontig_bg_test/spawn_inodes.c | 6 +++---
 programs/inline-data/inline-data.c        | 4 ++--
 programs/inline-data/inline-dirs.c        | 4 ++--
 programs/reflink_tests/reflink_test.c     | 6 +++---
 programs/xattr_tests/xattr-test.c         | 6 +++---
 6 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/programs/directio_test/directio_test.c b/programs/directio_test/directio_test.c
index 21bc32c39163..8ba1f8083da8 100755
--- a/programs/directio_test/directio_test.c
+++ b/programs/directio_test/directio_test.c
@@ -211,7 +211,7 @@ static int teardown(void)
 	return ret;
 }
 
-static void sigchld_handler()
+static void sigchld_handler(int no_used)
 {
 	pid_t pid;
 	int status;
@@ -233,7 +233,7 @@ static void kill_all_children()
 	free(child_pid_list);
 }
 
-static void sigint_handler()
+static void sigint_handler(int no_used)
 {
 	kill_all_children();
 
@@ -241,7 +241,7 @@ static void sigint_handler()
 	kill(getpid(), SIGINT);
 }
 
-static void sigterm_handler()
+static void sigterm_handler(int no_used)
 {
 	kill_all_children();
 
diff --git a/programs/discontig_bg_test/spawn_inodes.c b/programs/discontig_bg_test/spawn_inodes.c
index 633f0a96d84e..81a8840250ff 100755
--- a/programs/discontig_bg_test/spawn_inodes.c
+++ b/programs/discontig_bg_test/spawn_inodes.c
@@ -61,7 +61,7 @@ static int usage(void)
 	exit(1);
 }
 
-static void sigchld_handler()
+static void sigchld_handler(int no_used)
 {
 	pid_t   pid;
 	int status;
@@ -82,7 +82,7 @@ static void kill_all_children()
 			kill(child_pid_list[i], SIGTERM);
 }
 
-static void sigint_handler()
+static void sigint_handler(int no_used)
 {
 	kill_all_children();
 
@@ -90,7 +90,7 @@ static void sigint_handler()
 	kill(getpid(), SIGINT);
 }
 
-static void sigterm_handler()
+static void sigterm_handler(int no_used)
 {
 	kill_all_children();
 
diff --git a/programs/inline-data/inline-data.c b/programs/inline-data/inline-data.c
index c04514ea0e1b..d281d09dc271 100644
--- a/programs/inline-data/inline-data.c
+++ b/programs/inline-data/inline-data.c
@@ -269,7 +269,7 @@ static void kill_all_children()
 		free(child_pid_list_mf);
 	}
 }
-static void sigint_handler()
+static void sigint_handler(int no_used)
 {
 	kill_all_children();
 
@@ -278,7 +278,7 @@ static void sigint_handler()
 
 }
 
-static void sigterm_handler()
+static void sigterm_handler(int no_used)
 {
 	kill_all_children();
 
diff --git a/programs/inline-data/inline-dirs.c b/programs/inline-data/inline-dirs.c
index 140638dfcb77..a1b71a56b2e1 100644
--- a/programs/inline-data/inline-dirs.c
+++ b/programs/inline-data/inline-dirs.c
@@ -370,7 +370,7 @@ static void kill_all_children()
 	free(child_pid_list);
 }
 
-static void sigint_handler()
+static void sigint_handler(int no_used)
 {
 	kill_all_children();
 
@@ -379,7 +379,7 @@ static void sigint_handler()
 
 }
 
-static void sigterm_handler()
+static void sigterm_handler(int no_used)
 {
 	kill_all_children();
 
diff --git a/programs/reflink_tests/reflink_test.c b/programs/reflink_tests/reflink_test.c
index 51c52d936f34..f0d0a180ae3a 100755
--- a/programs/reflink_tests/reflink_test.c
+++ b/programs/reflink_tests/reflink_test.c
@@ -962,7 +962,7 @@ bail:
 	return 0;
 }
 
-static void sigchld_handler()
+static void sigchld_handler(int no_used)
 {
 	pid_t pid;
 	int status;
@@ -984,7 +984,7 @@ static void kill_all_children()
 	free(child_pid_list);
 }
 
-static void sigint_handler()
+static void sigint_handler(int no_used)
 {
 	kill_all_children();
 
@@ -992,7 +992,7 @@ static void sigint_handler()
 	kill(getpid(), SIGINT);
 }
 
-static void sigterm_handler()
+static void sigterm_handler(int no_used)
 {
 	kill_all_children();
 
diff --git a/programs/xattr_tests/xattr-test.c b/programs/xattr_tests/xattr-test.c
index 77be780f6717..5c63652e80f9 100755
--- a/programs/xattr_tests/xattr-test.c
+++ b/programs/xattr_tests/xattr-test.c
@@ -298,7 +298,7 @@ static void judge_sys_return(int ret, const char *sys_func)
 	return;
 }
 
-static void sigchld_handler()
+static void sigchld_handler(int no_used)
 {
 	pid_t	pid;
 	int status;
@@ -324,7 +324,7 @@ static void kill_all_children()
 
 }
 
-static void sigint_handler()
+static void sigint_handler(int no_used)
 {
 	kill_all_children();
 
@@ -332,7 +332,7 @@ static void sigint_handler()
 	kill(getpid(), SIGINT);
 }
 
-static void sigterm_handler()
+static void sigterm_handler(int no_used)
 {
 	kill_all_children();
 
-- 
2.43.0

openSUSE Build Service is sponsored by