From: Torbjorn SVENSSON <torbjorn.svensson@foss.st.com>
To: <newlib@sourceware.org>
Subject: Re: [PATCH] Make SIG2STR_MAX usable in #if
Date: Wed, 21 Jun 2023 09:33:47 +0200 [thread overview]
Message-ID: <2e1320d9-f69f-83d4-2fdf-eff515a4f4f0@foss.st.com> (raw)
In-Reply-To: <CAD66C+bisTo5xtQ+-M5C+Tc+7vV3HvLK9PdX5gn8wjfMeY-FJw@mail.gmail.com>
#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
I have not read the specification, but how come it's 17 and 21?
From what I can tell, "RTMAX+65535" is not 4 shorter than "RTMAX+4294967295".
Kind regards,
Torbjörn
On 2023-06-21 03:22, Mingye Wang wrote:
> On Mon, Jun 19, 2023 at 5:00 PM Corinna Vinschen <vinschen@redhat.com> wrote:
>>
>> We could redefine SIG2STR_MAX as static values (still dependent on
>> __SIZEOF_INT__) and prepend the sizeof expressions as comments.
>>
>> Do you want to provide a patch?
>
> I guess? See the attached file for an attempt.
>
> Uh, what license am I supposed to say I am releasing this patch under?
>
> Sincerely,
> Mingye
next prev parent reply other threads:[~2023-06-21 7:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-19 6:15 [Bug?] SIG2STR_MAX not good for #if Mingye Wang
2023-06-19 9:00 ` Corinna Vinschen
2023-06-19 11:11 ` Joel Sherrill
2023-06-21 1:08 ` Mingye Wang
2023-06-21 1:22 ` [PATCH] Make SIG2STR_MAX usable in #if Mingye Wang
2023-06-21 7:33 ` Torbjorn SVENSSON [this message]
2023-06-21 9:13 ` Corinna Vinschen
2023-06-21 12:13 ` [PATCHv2] " Mingye Wang
2023-06-21 13:20 ` Corinna Vinschen
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=2e1320d9-f69f-83d4-2fdf-eff515a4f4f0@foss.st.com \
--to=torbjorn.svensson@foss.st.com \
--cc=newlib@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).