From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 4BF2B3858C66; Wed, 21 Jun 2023 13:20:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4BF2B3858C66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1687353618; bh=ezGc2EqptwnoPs6ljFcJMagGH4AiQj7S73Nb/qrYb5c=; h=From:To:Subject:Date:From; b=A85fINPo4HOErBbNAKQ4dzT4q9dzM7uD1I0PzCYttCGXq/opX9ml22BV79sKl03fo M9UyXgD+e87lQBfpmQ/ISoWCqKHotVEBSd+WmGNBnkkZRU4iREoldH7o2xPcXqyul3 khix+ZOnwWetykpuRHviVUOhhnkxGvcuC70XPmbw= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: newlib-cvs@sourceware.org Subject: [newlib-cygwin/main] Make SIG2STR_MAX usable in #if X-Act-Checkin: newlib-cygwin X-Git-Author: Mingye Wang X-Git-Refname: refs/heads/main X-Git-Oldrev: 6604db8b80bd8c5aed4673ade49f768b9f51898b X-Git-Newrev: 6b2ae32ecdfdb8ca1337e19fac3b6e0a4079e769 Message-Id: <20230621132018.4BF2B3858C66@sourceware.org> Date: Wed, 21 Jun 2023 13:20:18 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D6b2ae32ecdf= db8ca1337e19fac3b6e0a4079e769 commit 6b2ae32ecdfdb8ca1337e19fac3b6e0a4079e769 Author: Mingye Wang AuthorDate: Wed Jun 21 20:11:57 2023 +0800 Commit: Corinna Vinschen CommitDate: Wed Jun 21 15:15:03 2023 +0200 Make SIG2STR_MAX usable in #if =20 The text accepted for POSIX issue 8 requires that SIG2STR_MAX be usable in #if, which we currently break with sizeof. Use static values instead. Diff: --- newlib/libc/include/sys/signal.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/newlib/libc/include/sys/signal.h b/newlib/libc/include/sys/sig= nal.h index 8dc5fb9c34fc..96bf9781ae93 100644 --- a/newlib/libc/include/sys/signal.h +++ b/newlib/libc/include/sys/signal.h @@ -245,9 +245,9 @@ int sigqueue (pid_t, int, const union sigval); /* POSIX Issue 8 adds sig2str() and str2sig() */ =20 #if __SIZEOF_INT__ >=3D 4 -#define SIG2STR_MAX (sizeof("RTMAX+") + sizeof("4294967295") - 1) +#define SIG2STR_MAX 17 /* (sizeof("RTMAX+") + sizeof("4294967295") - 1) */ #else -#define SIG2STR_MAX (sizeof("RTMAX+") + sizeof("65535") - 1) +#define SIG2STR_MAX 12 /* (sizeof("RTMAX+") + sizeof("65535") - 1) */ #endif =20 int sig2str(int, char *);