]> sourceware.org Git - newlib-cygwin.git/commitdiff
libgloss fix for bfin port
authorJeff Law <jeffreyalaw@gmail.com>
Tue, 19 Dec 2023 04:29:12 +0000 (21:29 -0700)
committerJeff Law <jeffreyalaw@gmail.com>
Tue, 19 Dec 2023 04:29:51 +0000 (21:29 -0700)
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.

libgloss/bfin/syscalls.c

index 7bd0bede189d1cf32cca0d1a5d1d6d412e7d99e2..0497d1d987f1f90f88591911a013f529489fcf9f 100644 (file)
@@ -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);
 }
This page took 0.028666 seconds and 5 git commands to generate.