]> sourceware.org Git - newlib-cygwin.git/commitdiff
Fix various v850 problems
authorJeff Law <jeffreyalaw@gmail.com>
Wed, 20 Dec 2023 03:54:37 +0000 (20:54 -0700)
committerJeff Law <jeffreyalaw@gmail.com>
Wed, 20 Dec 2023 03:56:04 +0000 (20:56 -0700)
These fixes fall into a few different buckets.  First c99 doesn't allow a
parameter without a type.  So in cases where the type had previously been an
implicit int, make it an explicit int.  Second, for return values, don't allow
them to be implicit ints either, make them explicit. In a few cases change c89
function definitions to c99 function definitions.   Lastly include <stdlib.h>
in sbrk.c to get the prototype for abort () which we call when we detect a
heap/stack collision.

newlib/libc/sys/sysnecv850/_exit.c
newlib/libc/sys/sysnecv850/getpid.c
newlib/libc/sys/sysnecv850/isatty.c
newlib/libc/sys/sysnecv850/kill.c
newlib/libc/sys/sysnecv850/read.c
newlib/libc/sys/sysnecv850/sbrk.c

index 44d4132bd7d40e16dbb7eda778e4d7f7e3763fd1..7e1b09262e38f5dbf32adee26d557877a9a350aa 100644 (file)
@@ -23,7 +23,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
index 32ac7fbfb8744fe0f2b3502597ca1c28f134d2b5..f0fc4d8951acff8747ca3e914e0a6b4bfc38287b 100644 (file)
@@ -9,7 +9,8 @@ int __trap0 (int function, int p1, int p2, int p3);
 
 #define TRAP0(f, p1, p2, p3) __trap0(f, (int)(p1), (int)(p2), (int)(p3))
 
-_getpid (n)
+int
+_getpid (int n)
 {
   return 1;
 }
index 248ab5248f7db1e8cdfb65d5896e3c5999a04942..6e4f205f0f57b7c8e61cd50dcbf649291924fcb4 100644 (file)
@@ -9,8 +9,8 @@ int __trap0 (int function, int p1, int p2, int p3);
 
 #define TRAP0(f, p1, p2, p3) __trap0(f, (int)(p1), (int)(p2), (int)(p3))
 
-_isatty (fd)
-     int fd;
+int
+_isatty (int fd)
 {
   return 1;
 }
index 34e5db793cdc2c47fb0b5953fb5f8c81ecb19200..562eaf6c7017bac2394a15ff6e4938c5b05cfcf8 100644 (file)
@@ -10,9 +10,8 @@ int __trap0 (int function, int p1, int p2, int p3);
 
 #define TRAP0(f, p1, p2, p3) __trap0(f, (int)(p1), (int)(p2), (int)(p3))
 
-_kill (pid, sig)
-     pid_t pid;
-     int sig;
+int
+_kill (pid_t pid, int sig)
 {
   return TRAP0 (SYS_exit, 0xdead0000 | sig, 0, 0);
 }
index b55d1cb9e7db5122be04b7ba4f271f5f18213528..5ae2c97998eba4bf513133103ebaaf3e94a37224 100644 (file)
@@ -9,6 +9,7 @@ int __trap0 (int function, int p1, int p2, int p3);
 
 #define TRAP0(f, p1, p2, p3) __trap0(f, (int)(p1), (int)(p2), (int)(p3))
 
+int
 _read (int file,
        char *ptr,
        int len)
index 2893c322fdce68392a0d9da1aafcebe7b9ee81f7..b5673d467df2aecaed8bd41081e356a65631efd4 100644 (file)
@@ -2,7 +2,9 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include "sys/syscall.h"
+#include <stdlib.h>
 
+extern int _write (int, char *, int);
 caddr_t
 _sbrk (int incr)
 {
This page took 0.036192 seconds and 5 git commands to generate.