From: "Marc Nieper-Wißkirchen" <marc.nieper+gnu@gmail.com>
To: bug-gnulib@gnu.org
Subject: New function xpalloc in module xalloc
Date: Sun, 4 Apr 2021 08:17:08 +0200 [thread overview]
Message-ID: <CAEYrNrTWcLXUWw_Fno_-S3cfs-iDoA-5Kd0TfCHqpSB8tbw6Ow@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 534 bytes --]
GCC prints the following warning when compiling the new code:
lib/xmalloc.c: In function 'xpalloc':
lib/xmalloc.c:132:64: warning: comparison of integer expressions of
different signedness: 'long unsigned int' and 'idx_t' {aka 'long int'}
[-Wsign-compare]
132 | = ((INT_MULTIPLY_WRAPV (n, item_size, &nbytes) || SIZE_MAX <
nbytes)
If I understand the error message correctly, it is because 'nbytes' is a
signed type while SIZE_MAX is unsigned.
Does the comparison make any sense, by the way?
Thanks for investigating,
Marc
[-- Attachment #2: Type: text/html, Size: 1323 bytes --]
next reply other threads:[~2021-04-04 6:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-04 6:17 Marc Nieper-Wißkirchen [this message]
2021-04-04 6:23 ` New function xpalloc in module xalloc Jeffrey Walton
2021-04-04 6:43 ` Marc Nieper-Wißkirchen
2021-04-06 3:19 ` Paul Eggert
2021-04-06 6:48 ` Marc Nieper-Wißkirchen
2021-04-06 19:05 ` Paul Eggert
2021-04-06 19:23 ` Marc Nieper-Wißkirchen
2021-04-06 20:07 ` Paul Eggert
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
List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAEYrNrTWcLXUWw_Fno_-S3cfs-iDoA-5Kd0TfCHqpSB8tbw6Ow@mail.gmail.com \
--to=marc.nieper+gnu@gmail.com \
--cc=bug-gnulib@gnu.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).