Fix rl78 libgloss port for c99/gcc-14

Message ID ee225506-a8d4-463a-9618-ae2f5ba6a5af@gmail.com
State New
Headers
Series Fix rl78 libgloss port for c99/gcc-14 |

Commit Message

Jeff Law Dec. 23, 2023, 4:03 a.m. UTC
  Needed a prototype for SYS_write and the prototype for write was 
incorrect (returns an int, not a char *).

Pushed to the trunk.

Jeff L.
commit a1a21442bc938681913584d0941dd1c8b3c98fef
Author: Jeff Law <jeffreyalaw@gmail.com>
Date:   Fri Dec 22 21:00:35 2023 -0700

    Fix rl78 libgloss port for c99/gcc-14
    
    Needed a prototype for SYS_write and the prototype for write was incorrect
    (returns an int, not a char *).
  

Patch

diff --git a/libgloss/rl78/write.c b/libgloss/rl78/write.c
index 849470c94..4bc74ae3e 100644
--- a/libgloss/rl78/write.c
+++ b/libgloss/rl78/write.c
@@ -57,6 +57,7 @@  typedef unsigned int UHI __attribute__((mode(HI)));
 
 static int initted = 0;
 
+int _SYS_write (int, char *, int);
 static void
 init_uart0 ()
 {
@@ -108,4 +109,4 @@  _write(int fd, char *ptr, int len)
   return rv;
 }
 
-char * write (int) __attribute__((weak, alias ("_write")));
+int write (int, char *, int) __attribute__((weak, alias ("_write")));