From patchwork Fri Jan 22 17:02:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= X-Patchwork-Id: 8091401 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AED339F6FA for ; Fri, 22 Jan 2016 17:02:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 606972046F for ; Fri, 22 Jan 2016 17:02:49 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 35F0C20460 for ; Fri, 22 Jan 2016 17:02:48 +0000 (UTC) Received: from localhost ([::1]:54850 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMf6l-00009a-KP for patchwork-qemu-devel@patchwork.kernel.org; Fri, 22 Jan 2016 12:02:47 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37683) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMf6f-00009R-7V for qemu-devel@nongnu.org; Fri, 22 Jan 2016 12:02:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMf6b-0007V5-G1 for qemu-devel@nongnu.org; Fri, 22 Jan 2016 12:02:41 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54610) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMf6b-0007Uu-Ab for qemu-devel@nongnu.org; Fri, 22 Jan 2016 12:02:37 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id CDF6FB282B; Fri, 22 Jan 2016 17:02:36 +0000 (UTC) Received: from redhat.com (dhcp-1-180.lcy.redhat.com [10.32.224.180]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u0MH2YHn013226 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 22 Jan 2016 12:02:36 -0500 Date: Fri, 22 Jan 2016 17:02:33 +0000 From: "Daniel P. Berrange" To: Sean Bruno Message-ID: <20160122170233.GY14825@redhat.com> References: <56A25B27.1040009@freebsd.org> <56A25E54.9070001@freebsd.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <56A25E54.9070001@freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Peter Maydell , QEMU Developers Subject: Re: [Qemu-devel] [FreeBSD] Build Failure, qemu-char.c X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: "Daniel P. Berrange" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, Jan 22, 2016 at 08:52:36AM -0800, Sean Bruno wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 > > > > On 01/22/16 08:47, Peter Maydell wrote: > > > This one is just straightforwardly BSD-only code that hasn't been > > compile-tested. > > > >> qemu-char.c:4265:36: warning: incompatible pointer types passing > >> 'ChardevCommon *' (aka 'struct ChardevCommon *') to parameter of > >> type 'ChardevBackend *' (aka 'struct ChardevBackend *') > >> [-Wincompatible-pointer-types] return qemu_chr_open_pp_fd(fd, > >> common, errp); ^~~~~~ qemu-char.c:1838:61: note: passing argument > >> to parameter 'backend' here ChardevBackend *backend, > > > > This one looks like it ought to build on Linux so you're probably > > right about it being a clang-only thing. (We do build with clang on > > OSX but I think there the CHARDEV_PARPORT code is not compiled > > in.) > > > > thanks -- PMM > > > > Yeah, this is smack in the middle of #ifdef (random BSD) here. It > looks like a simple copy/paste error where "common" should have been > "backend". Fixes the build failure, but still emits a cast warning. > I think this is the intent of the changes however. > > index e133f4f..73eb10f 100644 > - --- a/qemu-char.c > +++ b/qemu-char.c > @@ -1840,7 +1840,7 @@ static CharDriverState *qemu_chr_open_pp_fd(int fd, > { > CharDriverState *chr; > > - - chr = qemu_chr_alloc(common, errp); > + chr = qemu_chr_alloc(backend, errp); > if (!chr) { > return NULL; > } Close, but you need to change the type of the parameter too. Can you test this for me If it solves it, i'll send a patch formally Regards, Daniel diff --git a/qemu-char.c b/qemu-char.c index e133f4f..aa2e660 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -1835,12 +1835,12 @@ static int pp_ioctl(CharDriverState *chr, int cmd, void *arg) } static CharDriverState *qemu_chr_open_pp_fd(int fd, - ChardevBackend *backend, + ChardevCommon *backend, Error **errp) { CharDriverState *chr; - chr = qemu_chr_alloc(common, errp); + chr = qemu_chr_alloc(backend, errp); if (!chr) { return NULL; }