From 0802d3650565f4192a931beb9676276480df8fb3 Mon Sep 17 00:00:00 2001 From: Mingye Wang Date: Wed, 21 Jun 2023 09:16:06 +0800 Subject: [PATCH] Make SIG2STR_MAX usable in #if The language accepted for POSIX issue 8 requires that SIG2STR_MAX be usable in #if, which we currently break with sizeof. Use static values instead. --- 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/signal.h index 8dc5fb9c34..18fee63691 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() */ #if __SIZEOF_INT__ >= 4 -#define SIG2STR_MAX (sizeof("RTMAX+") + sizeof("4294967295") - 1) +#define SIG2STR_MAX 21 /* (sizeof("RTMAX+") + sizeof("4294967295") - 1) */ #else -#define SIG2STR_MAX (sizeof("RTMAX+") + sizeof("65535") - 1) +#define SIG2STR_MAX 17 /* (sizeof("RTMAX+") + sizeof("65535") - 1) */ #endif int sig2str(int, char *);