libgloss fix for bfin port
Mike Frysinger
vapier@gentoo.org
Mon Dec 18 16:35:50 GMT 2023
On 16 Dec 2023 21:57, Jeff Law wrote:
> 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.
>
> OK for the trunk?
OK
> --- a/libgloss/bfin/syscalls.c
> +++ b/libgloss/bfin/syscalls.c
> @@ -27,6 +27,8 @@
> #include <reent.h>
> #include <unistd.h>
>
> +int main (int, char **, char **);
shouldn't it have `extern` for completeness at least ?
would be nice if we had more clarity on 2-vs-3 signature main in newlib,
but it's fine here to just set another register to 0 before calling.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/newlib/attachments/20231218/b3cab5db/attachment.sig>
More information about the Newlib
mailing list