From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2119) id 494623858C5F; Tue, 19 Dec 2023 04:30:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 494623858C5F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1702960204; bh=S27GpUoEVCK8/MdB01mr+NWeksmFmvJaCiSc5J3q1xs=; h=From:To:Subject:Date:From; b=saZSGQtBu4Wm66enUEztCgmJXWdz0RRjB1XCjXyR3X6k4E5dN4wPl1rrkKJqsBW1O 2XPgih9noxW1SCW7kjgzB4AAyD4arlyG6QUDH8v8HO67PYtdAE8KnWJVcEY17Tl7S3 tyfHMBAceShmB/onBgElRIrSa/dCjNK7ZrRdNDKM= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Jeff Law To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] libgloss fix for bfin port X-Act-Checkin: newlib-cygwin X-Git-Author: Jeff Law X-Git-Refname: refs/heads/master X-Git-Oldrev: 57e311e0deb23492edc94518c78cc57a224dbad9 X-Git-Newrev: c2c9f05a0542a0b299edacc916191ed051bf4f1e Message-Id: <20231219043004.494623858C5F@sourceware.org> Date: Tue, 19 Dec 2023 04:30:04 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3Dc2c9f05a054= 2a0b299edacc916191ed051bf4f1e commit c2c9f05a0542a0b299edacc916191ed051bf4f1e Author: Jeff Law Date: Mon Dec 18 21:29:12 2023 -0700 libgloss fix for bfin port =20 gcc-14 will complain loudly both for calling a function without an in-s= cope prototype or when the in scope prototype differs from the known signatu= re. =20 "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 mat= ches what GCC thinks it should be. =20 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 #include =20 +extern int main (int, char **, char **); + register char *stack_ptr asm ("SP"); =20 static inline int @@ -254,7 +256,7 @@ __setup_argv_for_main (int argc) do_syscall (SYS_argn, (void *)block); } =20 - return main (argc, argv); + return main (argc, argv, NULL); } =20 int @@ -263,7 +265,7 @@ __setup_argv_and_call_main () int argc =3D do_syscall (SYS_argc, 0); =20 if (argc <=3D 0) - return main (argc, NULL); + return main (argc, NULL, NULL); else return __setup_argv_for_main (argc); }