From nobody Sun Apr 28 07:02:52 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1496146232960617.9151946152465; Tue, 30 May 2017 05:10:32 -0700 (PDT) Received: from localhost ([::1]:53479 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dFfyo-0006QU-At for importer@patchew.org; Tue, 30 May 2017 08:10:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50751) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dFfy0-00063T-Sq for qemu-devel@nongnu.org; Tue, 30 May 2017 08:09:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dFfxx-0002o8-OB for qemu-devel@nongnu.org; Tue, 30 May 2017 08:09:40 -0400 Received: from mail-oi0-x241.google.com ([2607:f8b0:4003:c06::241]:33714) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dFfxx-0002o0-IP for qemu-devel@nongnu.org; Tue, 30 May 2017 08:09:37 -0400 Received: by mail-oi0-x241.google.com with SMTP id h4so15494897oib.0 for ; Tue, 30 May 2017 05:09:37 -0700 (PDT) Received: from yoga.attlocal.net (162-231-236-127.lightspeed.miamfl.sbcglobal.net. [162.231.236.127]) by smtp.gmail.com with ESMTPSA id w2sm2721896ota.19.2017.05.30.05.09.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 May 2017 05:09:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7Olg8VuDY+fI9RybAipa6zt4x60rU2jff8m3afSJltE=; b=bHhCA2DArxO+arBZDeNRUQm713173GyW/nGrAW/9IM4yF5OGaCZCwv7PZqntDKJrkg 1UQiY4dzOmA276Sw1+cbz/5Jp8Q2Jp2ZwK18cGLlGsbu/7EsJNR9ovtVL+oWtquIGz1X 9a0bQLuGP2Y0FaaOfOY4Sg8XkHniG9WmAsSPcVsNu9p6KADX0+mn7HZXMOX/k2z3uuGW 46WHYtlJ8xi6Q2K8jGg6pHALaJctM6q3apWCpjYo802SAgWG3JvepipjOd1dwydp/azF GNnv3HrehyY7wXTo9pVL+C7cXHbE13JyvPu/iOK8GO9buvgLmYNTH50qflY5DtgSGAW0 9oJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=7Olg8VuDY+fI9RybAipa6zt4x60rU2jff8m3afSJltE=; b=l/CV2sOGubWwffdY41ZlDzUe/ALQOEmQWv5HlU1alJ0s76jTDsVNS1dbs/A30WAC/o xTZv9eUhAmJfqCVnuDYDBJjL0fHf4nreLQXkLgD8rvD4av9onZYWEqNKtj5d2qCG1E4Z z/OEAGAzlGnE+egPFmuD6ygq8IFN6W7i/b7b4dqA0mkyk9LBkmWAlx9a89srwYaRaZi0 sQwMKpYibnLglbzGYr72EfjetBUxoy3787BiL07i8l1pVmJvh4iJc9HZEVVRT9GYRJgw vbfIgvVlsgv1Yql5e6PsieDEOPHfjsH6kPXs/eDdsrJKOI+rgqqEh6KjJcqcHkeGxw43 b5VQ== X-Gm-Message-State: AODbwcAS94NO7B0sw+MG9pOJvW/qbe+sbx2K3Zn+rLiBKGFfpfwrmpIr ZInSfY1VNtpkRGn8/LY= X-Received: by 10.157.45.56 with SMTP id v53mr6836609ota.68.1496146176556; Tue, 30 May 2017 05:09:36 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Tue, 30 May 2017 09:09:19 -0300 Message-Id: <20170530120919.8874-1-f4bug@amsat.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <149604983117.777.3318402617001973219@750cb16fd6f2> References: <149604983117.777.3318402617001973219@750cb16fd6f2> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c06::241 Subject: [Qemu-devel] [PATCH] char: cast ARRAY_SIZE() as signed to silent warning on empty array X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 chardev/char.c: In function 'chardev_name_foreach': chardev/char.c:546:19: error: comparison of unsigned expression < 0 is alwa= ys false [-Werror=3Dtype-limits] for (i =3D 0; i < ARRAY_SIZE(chardev_alias_table); i++) { ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau --- 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) =20 object_class_foreach(chardev_class_foreach, TYPE_CHARDEV, false, &fe); =20 - for (i =3D 0; i < ARRAY_SIZE(chardev_alias_table); i++) { + for (i =3D 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; } =20 - for (i =3D 0; i < ARRAY_SIZE(chardev_alias_table); i++) { + for (i =3D 0; i < (int)ARRAY_SIZE(chardev_alias_table); i++) { if (g_strcmp0(chardev_alias_table[i].alias, name) =3D=3D 0) { name =3D chardev_alias_table[i].typename; break; --=20 2.11.0