From: Steven J Abner <pheonix.sja@att.net>
To: newlib@sourceware.org
Subject: [PATCH v2] newlib: fix build with <gcc-5 versions
Date: Sun, 20 Mar 2022 12:13:54 -0400 [thread overview]
Message-ID: <1647792834.2524.0@smtp.mail.att.net> (raw)
In-Reply-To: <1647792834.2524.0.ref@smtp.mail.att.net>
I'm probably out of my depth, but along the same question:
Why 0 return and not ((bool)(((unsigned long long)(a) * (b)) >> 32))
or prepend with '!!'?
Steve
>On 20 Mar 2022 07:52, Eric Bresie wrote:
>> My C is a little rusty so forgive me up front if I’m not reading
something quite right…
>>
>> Trying to understand the basic logic, the macro is expected to
return Boolean but the expression is assigning the multiplication
results to the size and then always returning 0 (false). Is that flow
correct? Should there be some form of “==“ involved and/or ever
return non-zero number?
>it returns a bool to indicate whether there was overflow, but the
result of the
actual multiplication of the first two operands is stored in the 3rd
arg.
>a return value of true means "the value overflowed", not "the
multiplication
was successful". hence returning false is what the stub should do.
next parent reply other threads:[~2022-03-20 16:13 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1647792834.2524.0.ref@smtp.mail.att.net>
2022-03-20 16:13 ` Steven J Abner [this message]
[not found] <1647807849.2524.1.ref@smtp.mail.att.net>
2022-03-20 20:24 ` Steven J Abner
2022-03-14 3:25 [PATCH] " Mike Frysinger
2022-03-15 3:25 ` [PATCH v2] " Mike Frysinger
2022-03-15 12:41 ` Richard Earnshaw
2022-03-15 23:54 ` Mike Frysinger
2022-03-16 7:12 ` R. Diez
2022-03-16 8:30 ` Mike Frysinger
2022-03-16 9:17 ` R. Diez
2022-03-17 2:41 ` Mike Frysinger
2022-03-17 9:49 ` Corinna Vinschen
2022-03-17 11:26 ` Richard Earnshaw
2022-03-18 7:24 ` Corinna Vinschen
2022-03-18 8:30 ` R. Diez
2022-03-18 9:26 ` Corinna Vinschen
2022-03-18 9:45 ` R. Diez
2022-03-20 1:22 ` Mike Frysinger
2022-03-20 1:21 ` Mike Frysinger
2022-03-20 13:57 ` Jordi Sanfeliu
2022-03-20 12:52 ` Eric Bresie
2022-03-20 14:16 ` Mike Frysinger
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=1647792834.2524.0@smtp.mail.att.net \
--to=pheonix.sja@att.net \
--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).