public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* libgloss c99 fixes for mn10300-elf
@ 2023-12-20  5:05 Jeff Law
  2023-12-20 21:59 ` Jeff Johnston
  0 siblings, 1 reply; 2+ messages in thread
From: Jeff Law @ 2023-12-20  5:05 UTC (permalink / raw)
  To: newlib

[-- Attachment #1: Type: text/plain, Size: 170 bytes --]



Very similar to other patches in this space.  Avoid implicit int types 
and add missing #includes so that this code works with gcc-14.

OK for the trunk?

Thanks,
Jeff

[-- Attachment #2: P --]
[-- Type: text/plain, Size: 2111 bytes --]

diff --git a/libgloss/mn10300/_exit.c b/libgloss/mn10300/_exit.c
index ec51d4088..2b548e82e 100644
--- a/libgloss/mn10300/_exit.c
+++ b/libgloss/mn10300/_exit.c
@@ -18,7 +18,7 @@ static void _do_dtors()
 }
 
 
-void _exit (n)
+void _exit (int n)
 {
   /* Destructors should be done earlier because they need to be done before the
      files are closed, but here is better than nowhere (and this balances the
diff --git a/libgloss/mn10300/getpid.c b/libgloss/mn10300/getpid.c
index 20ab1866e..fea57daff 100644
--- a/libgloss/mn10300/getpid.c
+++ b/libgloss/mn10300/getpid.c
@@ -4,7 +4,8 @@
 #include "trap.h"
 
 
-_getpid (n)
+int
+_getpid (int n)
 {
   return 1;
 }
diff --git a/libgloss/mn10300/isatty.c b/libgloss/mn10300/isatty.c
index 7e63a8c7c..3d8eb1910 100644
--- a/libgloss/mn10300/isatty.c
+++ b/libgloss/mn10300/isatty.c
@@ -4,8 +4,8 @@
 #include "trap.h"
 
 
-_isatty (fd)
-     int fd;
+int
+_isatty (int fd)
 {
   return 1;
 }
diff --git a/libgloss/mn10300/kill.c b/libgloss/mn10300/kill.c
index 40afa6a2c..d63a2f82c 100644
--- a/libgloss/mn10300/kill.c
+++ b/libgloss/mn10300/kill.c
@@ -4,7 +4,8 @@
 #include "trap.h"
 
 
-_kill (n, m)
+int
+_kill (int n, int m)
 {
   return TRAP0 (SYS_exit, 0xdead, 0, 0);
 }
diff --git a/libgloss/mn10300/read.c b/libgloss/mn10300/read.c
index 31d24cce9..2f1878c06 100644
--- a/libgloss/mn10300/read.c
+++ b/libgloss/mn10300/read.c
@@ -4,6 +4,7 @@
 #include "trap.h"
 
 
+int
 _read (int file,
        char *ptr,
        size_t len)
diff --git a/libgloss/mn10300/sbrk.c b/libgloss/mn10300/sbrk.c
index 376fd3285..78945e77a 100644
--- a/libgloss/mn10300/sbrk.c
+++ b/libgloss/mn10300/sbrk.c
@@ -1,8 +1,11 @@
 #include <_ansi.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <stdlib.h>
 #include "trap.h"
 
+extern int _write (int, char *, size_t);
+
 
 caddr_t
 _sbrk (size_t incr)
diff --git a/libgloss/mn10300/test.c b/libgloss/mn10300/test.c
index 9ea873adf..a61dbb797 100644
--- a/libgloss/mn10300/test.c
+++ b/libgloss/mn10300/test.c
@@ -1,4 +1,6 @@
 #include <stdio.h>
+#include <unistd.h>
+#include <string.h>
 
 static void
 send_msg1 (void)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: libgloss c99 fixes for mn10300-elf
  2023-12-20  5:05 libgloss c99 fixes for mn10300-elf Jeff Law
@ 2023-12-20 21:59 ` Jeff Johnston
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Johnston @ 2023-12-20 21:59 UTC (permalink / raw)
  To: Jeff Law; +Cc: newlib

[-- Attachment #1: Type: text/plain, Size: 307 bytes --]

Please go ahead.

-- Jeff J.

On Wed, Dec 20, 2023 at 12:05 AM Jeff Law <jeffreyalaw@gmail.com> wrote:

>
>
> Very similar to other patches in this space.  Avoid implicit int types
> and add missing #includes so that this code works with gcc-14.
>
> OK for the trunk?
>
> Thanks,
> Jeff
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-12-20 21:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-20  5:05 libgloss c99 fixes for mn10300-elf Jeff Law
2023-12-20 21:59 ` Jeff Johnston

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).