Fix moxie libgloss issues with c99

Message ID 0d476ceb-d413-4f68-953a-3b9a4634fff8@gmail.com
State New
Headers
Series Fix moxie libgloss issues with c99 |

Commit Message

Jeff Law Dec. 14, 2023, 7:26 p.m. UTC
  Two libgloss issues specific to moxie-elf that show up build with GCC trunk.

First, putnum.c uses "print" without a prototype.  So I added one based 
on the function's definition in print.c.  Second sim-inbyte.c uses read, 
which comes from unistd.h, so this adds a suitable #include.

OK for the trunk?

Jeff
diff --git a/libgloss/frv/putnum.c b/libgloss/frv/putnum.c
  

Comments

Jeff Johnston Dec. 15, 2023, 2:53 a.m. UTC | #1
Please go ahead.

-- Jeff J.

On Thu, Dec 14, 2023 at 2:26 PM Jeff Law <jeffreyalaw@gmail.com> wrote:

>
> Two libgloss issues specific to moxie-elf that show up build with GCC
> trunk.
>
> First, putnum.c uses "print" without a prototype.  So I added one based
> on the function's definition in print.c.  Second sim-inbyte.c uses read,
> which comes from unistd.h, so this adds a suitable #include.
>
> OK for the trunk?
>
> Jeff
  

Patch

diff --git a/libgloss/moxie/putnum.c b/libgloss/moxie/putnum.c
index 0f7e89453..9af5b4d4c 100644
--- a/libgloss/moxie/putnum.c
+++ b/libgloss/moxie/putnum.c
@@ -14,6 +14,8 @@ 
  */
 #include "glue.h"
 
+void print (char *);
+
 /*
  * putnum -- print a 32 bit number in hex
  */
diff --git a/libgloss/moxie/sim-inbyte.c b/libgloss/moxie/sim-inbyte.c
index 1e7466a8d..57d058741 100644
--- a/libgloss/moxie/sim-inbyte.c
+++ b/libgloss/moxie/sim-inbyte.c
@@ -14,6 +14,8 @@ 
  * they apply.
  */
 
+#include <unistd.h>
+
 int
 inbyte ()
 {