From: "Marc-André Lureau" <marcandre.lureau@redhat.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] char: cast ARRAY_SIZE() as signed to silent warning on empty array
Date: Tue, 30 May 2017 08:38:08 -0400 (EDT) [thread overview]
Message-ID: <2057521978.23705230.1496147888677.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20170530120919.8874-1-f4bug@amsat.org>
----- Original Message -----
> chardev/char.c: In function 'chardev_name_foreach':
> chardev/char.c:546:19: error: comparison of unsigned expression < 0 is always
> false [-Werror=type-limits]
> for (i = 0; i < ARRAY_SIZE(chardev_alias_table); i++) {
> ^
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> chardev/char.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/chardev/char.c b/chardev/char.c
> index 4e3808aefc..7aa0210765 100644
> --- a/chardev/char.c
> +++ b/chardev/char.c
> @@ -543,7 +543,7 @@ chardev_name_foreach(void (*fn)(const char *name, void
> *opaque), void *opaque)
>
> object_class_foreach(chardev_class_foreach, TYPE_CHARDEV, false, &fe);
>
> - for (i = 0; i < ARRAY_SIZE(chardev_alias_table); i++) {
> + for (i = 0; i < (int)ARRAY_SIZE(chardev_alias_table); i++) {
> fn(chardev_alias_table[i].alias, opaque);
> }
> }
> @@ -589,7 +589,7 @@ Chardev *qemu_chr_new_from_opts(QemuOpts *opts,
> return NULL;
> }
>
> - for (i = 0; i < ARRAY_SIZE(chardev_alias_table); i++) {
> + for (i = 0; i < (int)ARRAY_SIZE(chardev_alias_table); i++) {
> if (g_strcmp0(chardev_alias_table[i].alias, name) == 0) {
> name = chardev_alias_table[i].typename;
> break;
> --
> 2.11.0
>
>
prev parent reply other threads:[~2017-05-30 12:38 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-29 8:45 [Qemu-devel] [PATCH v2 00/14] chardev: misc clean-ups Marc-André Lureau
2017-05-29 8:45 ` [Qemu-devel] [PATCH v2 01/14] char-win: simplify win_chr_read() Marc-André Lureau
2017-05-29 8:45 ` [Qemu-devel] [PATCH v2 02/14] char-win: remove WinChardev.len Marc-André Lureau
2017-05-29 8:45 ` [Qemu-devel] [PATCH v2 03/14] char-win: rename win_chr_init/poll win_chr_serial_init/poll Marc-André Lureau
2017-05-29 8:45 ` [Qemu-devel] [PATCH v2 04/14] char-win: rename hcom->file Marc-André Lureau
2017-05-29 8:45 ` [Qemu-devel] [PATCH v2 05/14] char-win: close file handle except with console Marc-André Lureau
2017-05-29 8:45 ` [Qemu-devel] [PATCH v2 06/14] Remove/replace sysemu/char.h inclusion Marc-André Lureau
2017-05-29 20:57 ` Philippe Mathieu-Daudé
2017-05-29 8:45 ` [Qemu-devel] [PATCH v2 07/14] chardev: move headers to include/chardev Marc-André Lureau
2017-05-29 21:02 ` Philippe Mathieu-Daudé
2017-05-29 8:45 ` [Qemu-devel] [PATCH v2 08/14] chardev: serial & parallel declaration to own headers Marc-André Lureau
2017-05-29 21:03 ` Philippe Mathieu-Daudé
2017-05-29 8:45 ` [Qemu-devel] [PATCH v2 09/14] be-hci: use backend functions Marc-André Lureau
2017-05-29 8:45 ` [Qemu-devel] [PATCH v2 10/14] char: generalize qemu_chr_write_all() Marc-André Lureau
2017-05-29 21:09 ` Philippe Mathieu-Daudé
2017-05-30 5:59 ` Marc-André Lureau
2017-05-29 8:45 ` [Qemu-devel] [PATCH v2 11/14] char: move CharBackend handling in char-fe unit Marc-André Lureau
2017-05-29 21:25 ` Philippe Mathieu-Daudé
2017-06-07 16:41 ` Anthony PERARD
2017-06-07 17:20 ` Marc-André Lureau
2017-05-29 8:45 ` [Qemu-devel] [PATCH v2 12/14] char: rename functions that are not part of fe Marc-André Lureau
2017-05-29 8:45 ` [Qemu-devel] [PATCH v2 13/14] char: make chr_fe_deinit() optionaly delete backend Marc-André Lureau
2017-05-31 13:09 ` Marc-André Lureau
2017-06-02 4:52 ` Philippe Mathieu-Daudé
2017-05-29 8:45 ` [Qemu-devel] [PATCH v2 14/14] char: move char devices to chardev/ Marc-André Lureau
2017-05-29 21:31 ` Philippe Mathieu-Daudé
2017-05-30 15:18 ` Eric Blake
2017-05-31 14:01 ` Philippe Mathieu-Daudé
2017-05-29 9:23 ` [Qemu-devel] [PATCH v2 00/14] chardev: misc clean-ups no-reply
2017-05-30 12:09 ` [Qemu-devel] [PATCH] char: cast ARRAY_SIZE() as signed to silent warning on empty array Philippe Mathieu-Daudé
2017-05-30 12:38 ` Marc-André Lureau [this message]
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=2057521978.23705230.1496147888677.JavaMail.zimbra@redhat.com \
--to=marcandre.lureau@redhat.com \
--cc=f4bug@amsat.org \
--cc=qemu-devel@nongnu.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 NNTP newsgroup(s).