From nobody Wed May 8 05:11:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 150718862697035.79948787113244; Thu, 5 Oct 2017 00:30:26 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 779BA3E2A2; Thu, 5 Oct 2017 07:30:24 +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 BB34170534; Thu, 5 Oct 2017 07:30:22 +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 3083E410B2; Thu, 5 Oct 2017 07:30:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v957BHfP013016 for ; Thu, 5 Oct 2017 03:11:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id B1FF25C3FF; Thu, 5 Oct 2017 07:11:17 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.105]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8693A5C54B for ; Thu, 5 Oct 2017 07:11:15 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 58E2A1031BC; Thu, 5 Oct 2017 09:11:14 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 779BA3E2A2 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Jiri Denemark To: libvir-list@redhat.com Date: Thu, 5 Oct 2017 09:11:13 +0200 Message-Id: <2925f9395eedd75f1084d0f224f3d96b9c6eac43.1507187454.git.jdenemar@redhat.com> Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] tests: Fix build with clang 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 05 Oct 2017 07:30:25 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" clang doesn't like mode_t type as an argument to va_arg(): error: second argument to 'va_arg' is of promotable type 'mode_t' (aka 'unsigned short'); this va_arg has undefined behavior because arguments will be promoted to 'int' mode =3D va_arg(ap, mode_t); ^~~~~~ Signed-off-by: Jiri Denemark --- Pushed as a build-breaker. tests/virfilewrapper.c | 2 +- tests/virusbmock.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/virfilewrapper.c b/tests/virfilewrapper.c index 1d1d182708..3fd7f7aa8f 100644 --- a/tests/virfilewrapper.c +++ b/tests/virfilewrapper.c @@ -267,7 +267,7 @@ int open(const char *path, int flags, ...) */ if (flags & O_CREAT) { va_start(ap, flags); - mode =3D va_arg(ap, mode_t); + mode =3D (mode_t) va_arg(ap, int); va_end(ap); } =20 diff --git a/tests/virusbmock.c b/tests/virusbmock.c index f430a2edad..12083e2362 100644 --- a/tests/virusbmock.c +++ b/tests/virusbmock.c @@ -101,7 +101,7 @@ int open(const char *pathname, int flags, ...) */ if (flags & O_CREAT) { va_start(ap, flags); - mode =3D va_arg(ap, mode_t); + mode =3D (mode_t) va_arg(ap, int); va_end(ap); } =20 --=20 2.14.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list