From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2152) id 9F57E3857C7C; Wed, 6 Dec 2023 17:47:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9F57E3857C7C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1701884872; bh=CtdTfZ6BwoEl/XTxsIP1pk5ewJRPaKLfiwIGDSc7amc=; h=From:To:Subject:Date:From; b=HDssS7tGoXCaYa7l3sjWs0KDN6i8EWeKGpxyp+TKRdvnRy8hv9uXpGJXzbgF+4AzT OmBQlKr+nm0iJAGCJZCrE0vMJNWp5RHlihOjbqetZ6g2RRW2ime6TuBjWnLdLMSm+N gZPcsAndjSbl8oixX9msP2TNnST0x89WQDGgrFek= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Hans-Peter Nilsson To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] libgloss/cris: Make C declarations present and match them X-Act-Checkin: newlib-cygwin X-Git-Author: Hans-Peter Nilsson X-Git-Refname: refs/heads/master X-Git-Oldrev: 0737bda6ff5a104963c49f389ec102eaf8c5dd24 X-Git-Newrev: 7cce4cdd6e53abb1e89a871fc7511f0d8563d483 Message-Id: <20231206174752.9F57E3857C7C@sourceware.org> Date: Wed, 6 Dec 2023 17:47:52 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D7cce4cdd6e5= 3abb1e89a871fc7511f0d8563d483 commit 7cce4cdd6e53abb1e89a871fc7511f0d8563d483 Author: Hans-Peter Nilsson Date: Mon Dec 4 18:00:26 2023 +0100 libgloss/cris: Make C declarations present and match them =20 This is the libgloss part. Recently, there was a change in gcc such that implicit function declarations and type mismatches are now errors, no longer just warnings. Fix by adding and correcting declarations warned about; including the right header or adding a declaration (for "main" in lcrt0.c) and adjust to those types as necessary. Diff: --- libgloss/cris/gensyscalls | 15 ++++++++------- libgloss/cris/lcrt0.c | 4 +++- libgloss/cris/linunistd.h | 7 +++++-- libgloss/cris/outbyte.c | 2 +- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/libgloss/cris/gensyscalls b/libgloss/cris/gensyscalls index c36f28488..0b5b0731a 100644 --- a/libgloss/cris/gensyscalls +++ b/libgloss/cris/gensyscalls @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2005, 2018 Axis Communications. +# Copyright (C) 2005, 2018, 2023 Axis Communications. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -40,13 +40,14 @@ lu=3D'/* -*- buffer-read-only: t -*- #define R(x) return (x); } ' lui=3D"$lu int" +lul=3D"$lu long int" r=3D") { R (_Sys_" =20 cat > close.c < execve.c < exit.c < link.c < lseek.c < open.c < read.c < rename.c < wait.c < write.c < =20 #ifdef _HAVE_INITFINI_ARRAY #define _init __libc_init_array @@ -99,6 +100,7 @@ extern void _Libdtors (void); =20 extern void __init__start (void) __attribute ((weak)); extern void __aout__ctors (void) __attribute ((weak)); +extern int main (int argc, char **argv, char **env); =20 static void start1 () __asm__ ("__start1") __attribute ((__used__)); static void diff --git a/libgloss/cris/linunistd.h b/libgloss/cris/linunistd.h index 3a6f318a3..b627670f5 100644 --- a/libgloss/cris/linunistd.h +++ b/libgloss/cris/linunistd.h @@ -1,5 +1,5 @@ /* Support for syscalls for cris*-axis-linux-gnu and simulators - Copyright (C) 1998-2005, 2018 Axis Communications. + Copyright (C) 1998-2005, 2018, 2023 Axis Communications. All rights reserved. =20 Redistribution and use in source and binary forms, with or without @@ -32,10 +32,13 @@ #ifndef _ASM_ELINUX_UNISTD_H_ #define _ASM_ELINUX_UNISTD_H_ =20 +#define _LIBC + /* Our callers might want to use link_warning, so provide it from here. */ #include "../config.h" #include "libnosys/warning.h" =20 +#include #include =20 /* @@ -357,7 +360,7 @@ static inline _syscall0(int,setup) static inline _syscall0(int,sync) static inline _syscall3(int,write,int,fd,const char *,buf,unsigned,count) static inline _syscall1(int,dup,int,fd) -static inline _syscall3(int,execve,const char *,file,char **,argv,char **,= envp) +static inline _syscall3(int,execve,const char *,file,char *const *,argv,ch= ar *const *,envp) static inline _syscall3(int,open,const char *,file,int,flag,int,mode) static inline _syscall1(int,close,int,fd) static inline _syscall1(int,_exit,int,exitcode) diff --git a/libgloss/cris/outbyte.c b/libgloss/cris/outbyte.c index 1cb686b96..210339f8e 100644 --- a/libgloss/cris/outbyte.c +++ b/libgloss/cris/outbyte.c @@ -1,7 +1,7 @@ /* Low-level kind-of-support for CRIS. Mostly used as a placeholder function. Too small and obvious to warrant a copyright notice. */ =20 -#include +#include void outbyte (int ch) {