Re: libgloss fix for bfin port

Mike Frysinger <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <ZYB05kB1ZVi2dlKF@vapier>
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
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEuQK1JxMl+JKsJRrUQWM7n+g39YEFAmWAdOYACgkQQWM7n+g3
9YGlOQ//UY5l8OMGGU0CcPaGhmJL852uzgfLX+60+cDDinEHc1AqLCTkBfPXVnNS
qfznplWuWRdFqIubAXTDe9y15mW90h6mOnrwsS9rAI9ne5u5+RDSjvV+410DtACZ
LujMsUvg8Gpw0HAe4k4zstIpvA8gXGogRbvKj58i4TEvhH+mDR5SZ275kkESeMNO
v7GVNRSA/WEOxfnG9hrvIfnPXqc4G6ug2N7VODBQ7YPAa3IDusIkYl4GoFsTitOZ
b88NhcfZUiFgjxW3KDKIK7FaGaMR3m/sA4lTKWV599rtC9snZ8k77WUvXFfDNAFo
fj/Iq6qLAsAVkxku0qW81fOJLrlPisHAuuZkCACE5CsFVt16VMEzCa2kR4apAFF4
UYiPCOwDXbpJ8xPdmS+Y7NCK+UA/IHL4lrL8XRCnM/majgcNxX2bugiETdXOQEQL
vd+MzO0qAIm0un/2PsiT/esg6BjOVL7obL4lIhooWS54PZmCBr0kzAF2leDUcWu8
3TLKYIeFn5IjH6zzpaw3qqLba8TuGOzVkL6bE1hwREkjYlGIMJd6uAI372AThyk6
cLCjrWHMKCjNJ157fXucwLEmn4D+NBe4YlhEyf2gCtmXPcqf/ZuGdmIXG0JQ/KxM
BkJkOTl54c7h+ODqUred+MjGNrhuFRI3CauPFuYYHEw9XWw4ty0=
=dpT7
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.