From: Marcin Cieslak Subject: [PATCH 3/4] libxl: shutdown_reason cannot be unsigned Date: Sat, 13 Sep 2014 21:10:24 +0000 Message-ID: <1410642625-45876-3-git-send-email-saper@saper.info> References: <1410642625-45876-1-git-send-email-saper@saper.info> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XSuaY-0004kh-UN for xen-devel@lists.xenproject.org; Sat, 13 Sep 2014 21:10:35 +0000 In-Reply-To: <1410642625-45876-1-git-send-email-saper@saper.info> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Marcin Cieslak List-Id: xen-devel@lists.xenproject.org Shutdown reason may be negative, so don't cast it onto (unsigned int). Clang complains: xl_cmdimpl.c:3313:34: error: comparison of unsigned expression >= 0 is always true [-Werror,-Wtautological-compare] (shutdown_reason >= 0 && ~~~~~~~~~~~~~~~ ^ ~ --- tools/libxl/xl_cmdimpl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index 86daf8e..f9ca22a 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -3297,7 +3297,7 @@ static void list_domains(int verbose, int context, int claim, int numa, printf("\n"); for (i = 0; i < nb_domain; i++) { char *domname; - unsigned shutdown_reason; + int shutdown_reason; domname = libxl_domid_to_name(ctx, info[i].domid); shutdown_reason = info[i].shutdown ? info[i].shutdown_reason : 0; printf("%-40s %5d %5lu %5d %c%c%c%c%c%c %8.1f", -- 2.0.2