From nobody Sun Feb 8 18:24:08 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1600810445; cv=none; d=zohomail.com; s=zohoarc; b=Ci+X1y5CkYBniKkMcSQf6sUXxEjz5zsqnSj39QZn/uAiff13XacnW72CGOjYXUD6ZTje365CbzGhx7chEimttJfwNlvSTtlYYXCN4ia6KKvQJtkS0JAYrwPC0u9W/qWyPIJUzQnHPsRW2pvEfvK0I0hItIqQ1Fp8aA28xqA5aas= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600810445; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=5PjobLUoFMWK7l2PiMz7yiO+kCU3jLTVqKk+gxwurVQ=; b=FAxTiYPuyMxtmrGzFFppWxzLSEQ0xxWYmN3jQkQ9fMvY12f/Aza0AlOsiZ+5A88WWMet+waC7UjkwY/xxTVD8HVAMt32WkMZimNJWliCh5DTMRB2EWWrqzwtpc5/lyF0uFfUpLeoVJkS1w+aseIYNiatm9qgB0eWXdxOizmSry4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1600810445960228.01114960928658; Tue, 22 Sep 2020 14:34:05 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-527-rZf0lkvxM2ONZQg9aV0urQ-1; Tue, 22 Sep 2020 17:34:01 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 01025801ABB; Tue, 22 Sep 2020 21:33:55 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CF2EC1A923; Tue, 22 Sep 2020 21:33:54 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 999348C7AD; Tue, 22 Sep 2020 21:33:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08MLWobG022740 for ; Tue, 22 Sep 2020 17:32:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id 68357100164C; Tue, 22 Sep 2020 21:32:50 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id E26B01001901 for ; Tue, 22 Sep 2020 21:32:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600810444; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=5PjobLUoFMWK7l2PiMz7yiO+kCU3jLTVqKk+gxwurVQ=; b=bLChz3MHA/UDOUKliioJMeu2StfQecqmNGbr+bPjHRa+urk3795QHWq4G+FbNzTGU7Je5n NevPWqfVFhzakhxg+nj+2wmMc9nEh+IHW6h2VogMw3UMY6mA5GajS43krURZwazAo/ifWJ dpD67/wNg6EXNZq9Ee37PfLr4+ybhc8= X-MC-Unique: rZf0lkvxM2ONZQg9aV0urQ-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 5/5] Use (un)signed printf specifiers correctly Date: Tue, 22 Sep 2020 23:32:33 +0200 Message-Id: <42c0b30d5bd99e335b50119994b1bce540a80370.1600810297.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Various places reported by cppcheck's invalidPrintfArgType_sint and invalidPrintfArgType_uint. Signed-off-by: J=C3=A1n Tomko --- examples/c/domain/domtop.c | 2 +- examples/c/domain/suspend.c | 2 +- tests/qemusecuritymock.c | 2 +- tests/virhashtest.c | 4 ++-- tests/virpcimock.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/c/domain/domtop.c b/examples/c/domain/domtop.c index 15611c586d..5228445b7c 100644 --- a/examples/c/domain/domtop.c +++ b/examples/c/domain/domtop.c @@ -115,7 +115,7 @@ parse_argv(int argc, char *argv[], } *milliseconds =3D val; if (*milliseconds !=3D val) { - ERROR("Integer overflow: %ld", val); + ERROR("Integer overflow: %lu", val); exit(EXIT_FAILURE); } break; diff --git a/examples/c/domain/suspend.c b/examples/c/domain/suspend.c index 980c4584c7..3ff24f6861 100644 --- a/examples/c/domain/suspend.c +++ b/examples/c/domain/suspend.c @@ -105,7 +105,7 @@ parse_argv(int argc, char *argv[], } *seconds =3D val; if (*seconds !=3D val) { - ERROR("Integer overflow: %ld", val); + ERROR("Integer overflow: %lu", val); return -1; } break; diff --git a/tests/qemusecuritymock.c b/tests/qemusecuritymock.c index 6da8a91a9e..d544ae56cd 100644 --- a/tests/qemusecuritymock.c +++ b/tests/qemusecuritymock.c @@ -265,7 +265,7 @@ mock_chown(const char *path, int ret =3D -1; =20 if (gid >> 16 || uid >> 16) { - fprintf(stderr, "Attempt to set too high UID or GID: %lld %lld", + fprintf(stderr, "Attempt to set too high UID or GID: %llu %llu", (unsigned long long) uid, (unsigned long long) gid); abort(); } diff --git a/tests/virhashtest.c b/tests/virhashtest.c index 4d05cbb0f8..af30791241 100644 --- a/tests/virhashtest.c +++ b/tests/virhashtest.c @@ -34,7 +34,7 @@ testHashInit(int size) } =20 if (virHashTableSize(hash) !=3D oldsize) { - VIR_TEST_DEBUG("hash grown from %zd to %zd", + VIR_TEST_DEBUG("hash grown from %zu to %zu", (size_t)oldsize, (size_t)virHashTableSize(hash)); } } @@ -313,7 +313,7 @@ testHashRemoveSet(const void *data G_GNUC_UNUSED) =20 if (count !=3D rcount) { VIR_TEST_VERBOSE("\nvirHashRemoveSet didn't remove expected number= of" - " entries, %d !=3D %u", + " entries, %d !=3D %d", rcount, count); goto cleanup; } diff --git a/tests/virpcimock.c b/tests/virpcimock.c index 787172d24c..469aa01bb0 100644 --- a/tests/virpcimock.c +++ b/tests/virpcimock.c @@ -120,7 +120,7 @@ struct pciDeviceAddress { unsigned int device; unsigned int function; }; -# define ADDR_STR_FMT "%04x:%02x:%02x.%d" +# define ADDR_STR_FMT "%04x:%02x:%02x.%u" =20 struct pciDevice { struct pciDeviceAddress addr; --=20 2.26.2