public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jeff Law <law@sourceware.org>
To: newlib-cvs@sourceware.org
Subject: [newlib-cygwin] libgloss fix for bfin port
Date: Tue, 19 Dec 2023 04:30:04 +0000 (GMT)	[thread overview]
Message-ID: <20231219043004.494623858C5F@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=c2c9f05a0542a0b299edacc916191ed051bf4f1e

commit c2c9f05a0542a0b299edacc916191ed051bf4f1e
Author: Jeff Law <jeffreyalaw@gmail.com>
Date:   Mon Dec 18 21:29:12 2023 -0700

    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.

Diff:
---
 libgloss/bfin/syscalls.c | 6 ++++--
 1 file 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);
 }

                 reply	other threads:[~2023-12-19  4:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20231219043004.494623858C5F@sourceware.org \
    --to=law@sourceware.org \
    --cc=newlib-cvs@sourceware.org \
    /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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).