public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org>
To: newlib-cvs@sourceware.org
Subject: [newlib-cygwin/main] Make SIG2STR_MAX usable in #if
Date: Wed, 21 Jun 2023 13:20:18 +0000 (GMT)	[thread overview]
Message-ID: <20230621132018.4BF2B3858C66@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=6b2ae32ecdfdb8ca1337e19fac3b6e0a4079e769

commit 6b2ae32ecdfdb8ca1337e19fac3b6e0a4079e769
Author:     Mingye Wang <arthur200126@gmail.com>
AuthorDate: Wed Jun 21 20:11:57 2023 +0800
Commit:     Corinna Vinschen <corinna@vinschen.de>
CommitDate: Wed Jun 21 15:15:03 2023 +0200

    Make SIG2STR_MAX usable in #if
    
    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/signal.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() */
 
 #if __SIZEOF_INT__ >= 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
 
 int sig2str(int, char *);

                 reply	other threads:[~2023-06-21 13:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230621132018.4BF2B3858C66@sourceware.org \
    --to=corinna@sourceware.org \
    --cc=newlib-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).