Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 16 Apr 2023 22:41:30 +0200
From: Jens Gustedt <Jens.Gustedt@...ia.fr>
To: musl@...ts.openwall.com
Subject: [C23 implied 1/2] C23: update some legacy function pointers

In C23, empty parameter lists loose their meaning as "function that
may receive any number of parameters".

When compiling with -std=c2x, there were three left-overs in musl that
still used that. Change them to use the correct prototype, since it is
available at all these places, anyhow.
---
 src/legacy/ftw.c            | 2 +-
 src/thread/__syscall_cp.c   | 4 +++-
 src/thread/pthread_cancel.c | 8 ++++++--
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/legacy/ftw.c b/src/legacy/ftw.c
index e757fc6f..8e9e34d7 100644
--- a/src/legacy/ftw.c
+++ b/src/legacy/ftw.c
@@ -5,5 +5,5 @@ int ftw(const char *path, int (*fn)(const char *, const struct stat *, int), int
 	/* The following cast assumes that calling a function with one
 	 * argument more than it needs behaves as expected. This is
 	 * actually undefined, but works on all real-world machines. */
-	return nftw(path, (int (*)())fn, fd_limit, FTW_PHYS);
+	return nftw(path, (int (*)(const char *, const struct stat *, int, struct FTW *))fn, fd_limit, FTW_PHYS);
 }
diff --git a/src/thread/__syscall_cp.c b/src/thread/__syscall_cp.c
index 42a01674..d0b675e2 100644
--- a/src/thread/__syscall_cp.c
+++ b/src/thread/__syscall_cp.c
@@ -1,7 +1,9 @@
 #include "pthread_impl.h"
 #include "syscall.h"
 
-hidden long __syscall_cp_c();
+hidden long __syscall_cp_c(syscall_arg_t nr,
+                 syscall_arg_t u, syscall_arg_t v, syscall_arg_t w,
+                 syscall_arg_t x, syscall_arg_t y, syscall_arg_t z);
 
 static long sccp(syscall_arg_t nr,
                  syscall_arg_t u, syscall_arg_t v, syscall_arg_t w,
diff --git a/src/thread/pthread_cancel.c b/src/thread/pthread_cancel.c
index 139a6fc8..2b8a8a76 100644
--- a/src/thread/pthread_cancel.c
+++ b/src/thread/pthread_cancel.c
@@ -3,7 +3,7 @@
 #include "pthread_impl.h"
 #include "syscall.h"
 
-hidden long __cancel(), __syscall_cp_asm(), __syscall_cp_c();
+hidden long __cancel();
 
 long __cancel()
 {
@@ -14,10 +14,14 @@ long __cancel()
 	return -ECANCELED;
 }
 
-long __syscall_cp_asm(volatile void *, syscall_arg_t,
+hidden long __syscall_cp_asm(volatile void *, syscall_arg_t,
                       syscall_arg_t, syscall_arg_t, syscall_arg_t,
                       syscall_arg_t, syscall_arg_t, syscall_arg_t);
 
+hidden long __syscall_cp_c(syscall_arg_t,
+                    syscall_arg_t, syscall_arg_t, syscall_arg_t,
+                    syscall_arg_t, syscall_arg_t, syscall_arg_t);
+
 long __syscall_cp_c(syscall_arg_t nr,
                     syscall_arg_t u, syscall_arg_t v, syscall_arg_t w,
                     syscall_arg_t x, syscall_arg_t y, syscall_arg_t z)
-- 
2.34.1

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.