Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Law <jeffreyalaw@gmail.com>2023-12-19 07:29:12 +0300
committerJeff Law <jeffreyalaw@gmail.com>2023-12-19 07:29:51 +0300
commitc2c9f05a0542a0b299edacc916191ed051bf4f1e (patch)
tree58a25d011c7531f2e23ceb91f36e81889620e1c5 /libgloss/bfin
parent57e311e0deb23492edc94518c78cc57a224dbad9 (diff)
libgloss fix for bfin port
gcc-14 will complain loudly both for calling a function without an in-scope prototype or when the in scope prototype differs from the known signature. "main" happens to be one of the functions the compiler knows about. So not only do we need to prototype it, we need to make sure the prototype matches what GCC thinks it should be. This fixes the bfin libgloss port to do the right thing for bfin-elf.
Diffstat (limited to 'libgloss/bfin')
-rw-r--r--libgloss/bfin/syscalls.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libgloss/bfin/syscalls.c b/libgloss/bfin/syscalls.c
index 7bd0bede1..0497d1d98 100644
--- a/libgloss/bfin/syscalls.c
+++ b/libgloss/bfin/syscalls.c
@@ -27,6 +27,8 @@
#include <reent.h>
#include <unistd.h>
+extern int main (int, char **, char **);
+
register char *stack_ptr asm ("SP");
static inline int
@@ -254,7 +256,7 @@ __setup_argv_for_main (int argc)
do_syscall (SYS_argn, (void *)block);
}
- return main (argc, argv);
+ return main (argc, argv, NULL);
}
int
@@ -263,7 +265,7 @@ __setup_argv_and_call_main ()
int argc = do_syscall (SYS_argc, 0);
if (argc <= 0)
- return main (argc, NULL);
+ return main (argc, NULL, NULL);
else
return __setup_argv_for_main (argc);
}