mailing list of musl libc
 help / color / mirror / code / Atom feed
From: megous@megous.com
To: musl@lists.openwall.com
Cc: Ondrej Jirman <megous@megous.com>
Subject: [RFC PATCH] Fix __libc_start_main prototype in [r]crt1.c to match the caller
Date: Wed, 21 Nov 2018 15:51:50 +0100	[thread overview]
Message-ID: <20181121145150.15500-1-megous@megous.com> (raw)

From: Ondrej Jirman <megous@megous.com>

__libc_start_main function is not using the last three arguments.

GCC in LTO mode complains about mismatch.
---
 crt/crt1.c  | 6 +++---
 crt/rcrt1.c | 7 ++++---
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/crt/crt1.c b/crt/crt1.c
index 7b12665f..81ecf118 100644
--- a/crt/crt1.c
+++ b/crt/crt1.c
@@ -8,12 +8,12 @@
 int main();
 weak void _init();
 weak void _fini();
-_Noreturn int __libc_start_main(int (*)(), int, char **,
-	void (*)(), void(*)(), void(*)());
+_Noreturn
+int __libc_start_main(int (*main)(int,char **,char **), int argc, char **argv);
 
 void _start_c(long *p)
 {
 	int argc = p[0];
 	char **argv = (void *)(p+1);
-	__libc_start_main(main, argc, argv, _init, _fini, 0);
+	__libc_start_main(main, argc, argv);
 }
diff --git a/crt/rcrt1.c b/crt/rcrt1.c
index 7bb3322f..52928b3e 100644
--- a/crt/rcrt1.c
+++ b/crt/rcrt1.c
@@ -5,10 +5,11 @@
 int main();
 weak void _init();
 weak void _fini();
-_Noreturn int __libc_start_main(int (*)(), int, char **,
-	void (*)(), void(*)(), void(*)());
+
+_Noreturn
+int __libc_start_main(int (*main)(int,char **,char **), int argc, char **argv);
 
 hidden _Noreturn void __dls2(unsigned char *base, size_t *sp)
 {
-	__libc_start_main(main, *sp, (void *)(sp+1), _init, _fini, 0);
+	__libc_start_main(main, *sp, (void *)(sp+1));
 }
-- 
2.19.1



             reply	other threads:[~2018-11-21 14:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-21 14:51 megous [this message]
2018-11-21 15:09 ` Szabolcs Nagy
2018-11-21 15:22   ` Szabolcs Nagy
2018-11-21 16:10     ` Rich Felker
2018-11-21 16:15     ` Ondřej Jirman

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=20181121145150.15500-1-megous@megous.com \
    --to=megous@megous.com \
    --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).