mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Jens Gustedt <Jens.Gustedt@inria.fr>
To: musl@lists.openwall.com
Subject: [musl] [C23 implied 1/2] C23: update some legacy function pointers
Date: Sun, 16 Apr 2023 22:41:30 +0200	[thread overview]
Message-ID: <580d6560aaf8ed1d7894f881de51a170cfa8ad73.1684922612.git.Jens.Gustedt@inria.fr> (raw)
In-Reply-To: <cover.1684922612.git.Jens.Gustedt@inria.fr>

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

  reply	other threads:[~2023-05-24 13:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-24 10:03 [musl] [C23 implied 0/2] stuff detected with the intended changes Jens Gustedt
2023-04-16 20:41 ` Jens Gustedt [this message]
2023-04-17 19:30 ` [musl] [C23 implied 2/2] clang: only exclude C library includes, but allow compiler specific headers Jens Gustedt
2023-05-24 13:32   ` Rich Felker
2023-05-24 13:39     ` Jₑₙₛ Gustedt

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 \
    --in-reply-to=580d6560aaf8ed1d7894f881de51a170cfa8ad73.1684922612.git.Jens.Gustedt@inria.fr \
    --to=jens.gustedt@inria.fr \
    --cc=musl@lists.openwall.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).