From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2152) id A77A8385E02B; Wed, 6 Dec 2023 17:47:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A77A8385E02B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1701884877; bh=Y6IgFipt0ef0AUB9TJr+DLMsBaAYS2UyGMVkyvq9AHQ=; h=From:To:Subject:Date:From; b=RrsIbDyWvJe8VOLy4lMujy/X+Krvs6HlH9ir8bDBT1SUP4KjX5MNfFAYdmWlcPOMj moh8q7PJXno0rgs8WNnDe2rYclWZbFO+Ul7bqNlXTS5EePriIOTSi4v2ocssHgJ47p PbQRup+5nJ/E8JovlKsSlmS2S5bhLmRSjCq9uc4c= 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] newlib cris: Fix compilation warnings that recent gcc treats as errors X-Act-Checkin: newlib-cygwin X-Git-Author: Hans-Peter Nilsson X-Git-Refname: refs/heads/master X-Git-Oldrev: 7cce4cdd6e53abb1e89a871fc7511f0d8563d483 X-Git-Newrev: 3bafe2fae7a0878598a82777c623edb2faa70b74 Message-Id: <20231206174757.A77A8385E02B@sourceware.org> Date: Wed, 6 Dec 2023 17:47:57 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D3bafe2fae7a= 0878598a82777c623edb2faa70b74 commit 3bafe2fae7a0878598a82777c623edb2faa70b74 Author: Hans-Peter Nilsson Date: Sat Dec 2 02:20:17 2023 +0100 newlib cris: Fix compilation warnings that recent gcc treats as errors =20 For the newlib part, warnings are all from lack of sync between libc/machine/cris/sys/signal.h and libc/include/sys/signal.h. This commit gets them sufficiently in sync again, functionality-wise and declaration-wise. Still, nothing is declared that isn't supported at the system level (i.e. in libgloss system calls and handled by the CRIS simulator in the gdb project). Diff: --- newlib/libc/machine/cris/sys/signal.h | 43 ++++++++++++++++++++++++++++++-= ---- 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/newlib/libc/machine/cris/sys/signal.h b/newlib/libc/machine/cr= is/sys/signal.h index 9cb7ba530..7b6f3fa9b 100644 --- a/newlib/libc/machine/cris/sys/signal.h +++ b/newlib/libc/machine/cris/sys/signal.h @@ -12,6 +12,8 @@ extern "C" { #endif =20 #include "_ansi.h" +#include +#include =20 typedef unsigned long sigset_t; =20 @@ -32,21 +34,50 @@ struct sigaction { =20 /* Adjusted to glibc; other values. */ #define SA_NOCLDSTOP 1 /* only value supported now for sa_flags */ + +#if __POSIX_VISIBLE #define SIG_SETMASK 2 /* set mask with sigprocmask() */ #define SIG_BLOCK 0 /* set of signals to block */ #define SIG_UNBLOCK 1 /* set of signals to, well, unblock */ =20 +int sigprocmask (int __how, const sigset_t *__a, sigset_t *__b); +#endif /* __POSIX_VISIBLE */ + +#ifdef _LIBC +int _kill (pid_t, int); +#endif + +#if __POSIX_VISIBLE + +int kill (pid_t, int); +int sigaddset (sigset_t *, const int); +int sigdelset (sigset_t *, const int); +int sigismember (const sigset_t *, int); +int sigfillset (sigset_t *); +int sigemptyset (sigset_t *); + /* These depend upon the type of sigset_t, which right now is always a long.. They're in the POSIX namespace, but are not ANSI. */ -#define sigaddset(what,sig) (*(what) |=3D (1<<(sig))) -#define sigemptyset(what) (*(what) =3D 0) +#define sigaddset(what,sig) (*(what) |=3D (1<<(sig)), 0) +#define sigdelset(what,sig) (*(what) &=3D ~(1<<(sig)), 0) +#define sigemptyset(what) (*(what) =3D 0, 0) +#define sigfillset(what) (*(what) =3D ~(0), 0) +#define sigismember(what,sig) (((*(what)) & (1<<(sig))) !=3D 0) =20 -int sigprocmask (int __how, const sigset_t *__a, sigset_t *__b); +#endif /* __POSIX_VISIBLE */ + +/* Using __MISC_VISIBLE until POSIX Issue 8 is officially released */ +#if __MISC_VISIBLE + +/* POSIX Issue 8 adds sig2str() and str2sig() */ + +#define SIG2STR_MAX 17 /* (sizeof("RTMAX+") + sizeof("4294967295") - 1) */ + +int sig2str(int, char *); +int str2sig(const char *__restrict, int *__restrict); =20 -/* The first argument is really a pid_t, but that's just a typedef'd - int, so let's avoid requiring sys/types only for this declaration. */ -int kill (int, int); +#endif /* __MISC_VISIBLE */ =20 #define SIGHUP 1 #define SIGINT 2