diff options
author | Jeff Law <jeffreyalaw@gmail.com> | 2023-12-21 00:01:54 -0700 |
---|---|---|
committer | Jeff Law <jeffreyalaw@gmail.com> | 2023-12-21 00:01:54 -0700 |
commit | 7a45daad9184e30c336f27b3e54b9c5bcc2d3f77 (patch) | |
tree | 218aa7ee58cba219aed39129f869b176f96223ec /libgloss/mn10300 | |
parent | 5fa3b84da08f8dc03ee55c58cfc63e9b4450285a (diff) | |
download | newlib-7a45daad9184e30c336f27b3e54b9c5bcc2d3f77.zip newlib-7a45daad9184e30c336f27b3e54b9c5bcc2d3f77.tar.gz newlib-7a45daad9184e30c336f27b3e54b9c5bcc2d3f77.tar.bz2 |
Re: libgloss c99 fixes for mn10300-elf
Very similar to other patches in this space. Avoid implicit int types and add
missing #includes so that this code works with gcc-14.
Diffstat (limited to 'libgloss/mn10300')
-rw-r--r-- | libgloss/mn10300/_exit.c | 2 | ||||
-rw-r--r-- | libgloss/mn10300/getpid.c | 3 | ||||
-rw-r--r-- | libgloss/mn10300/isatty.c | 4 | ||||
-rw-r--r-- | libgloss/mn10300/kill.c | 3 | ||||
-rw-r--r-- | libgloss/mn10300/read.c | 1 | ||||
-rw-r--r-- | libgloss/mn10300/sbrk.c | 3 | ||||
-rw-r--r-- | libgloss/mn10300/test.c | 2 |
7 files changed, 13 insertions, 5 deletions
diff --git a/libgloss/mn10300/_exit.c b/libgloss/mn10300/_exit.c index ec51d40..2b548e8 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 20ab186..fea57da 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 7e63a8c..3d8eb19 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 40afa6a..d63a2f8 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 31d24cc..2f1878c 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 376fd32..78945e7 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 9ea873a..a61dbb7 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) |