* [Qemu-devel] [FreeBSD] Build Failure, qemu-char.c @ 2016-01-22 16:39 Sean Bruno 2016-01-22 16:47 ` Peter Maydell 0 siblings, 1 reply; 5+ messages in thread From: Sean Bruno @ 2016-01-22 16:39 UTC (permalink / raw) To: qemu-devel -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Started seeing a build failure after the updates to qemu-char.c I think clang is not doing something that gcc does implicitly? qemu-char.c:1843:26: error: use of undeclared identifier 'common' chr = qemu_chr_alloc(common, errp); ^ 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, -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAEBCgBmBQJWolskXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRCQUFENDYzMkU3MTIxREU4RDIwOTk3REQx MjAxRUZDQTFFNzI3RTY0AAoJEBIB78oecn5kdR8H/2UBG5pnCSuKexVqBHyn8coF 85aBuXf5/lz/pPdlU1Wp2wmM/i1isoizxoUYit98hBx4xwu/dFh53CQUPbGgYQBx LoPLkdwavs7bNT7zQ4PeB1Jm4GN7qqK321mOc1GGOmrWkEyl70fGDUUBN1Cjeo7F EULAaAmzrTadPHx2gaHUiEGABPHfPmwevaRLnSIbhjPbqqrf/gBy1w5LFJoDCBid /oOUzJBjzAT1pFz5y3ecyomjz+TUdLtd8LShDcwZtPloheDEvst4UyCg0Sp3z/51 xvk06ZRncTr9Ks5Q+dnVDBKkf3Z8KP0RnX4Kq3q1dTJAXAa4pBcutw8Q7B+29tQ= =75/8 -----END PGP SIGNATURE----- ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [FreeBSD] Build Failure, qemu-char.c 2016-01-22 16:39 [Qemu-devel] [FreeBSD] Build Failure, qemu-char.c Sean Bruno @ 2016-01-22 16:47 ` Peter Maydell 2016-01-22 16:52 ` Sean Bruno 0 siblings, 1 reply; 5+ messages in thread From: Peter Maydell @ 2016-01-22 16:47 UTC (permalink / raw) To: Sean Bruno; +Cc: QEMU Developers On 22 January 2016 at 16:39, Sean Bruno <sbruno@freebsd.org> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 > > Started seeing a build failure after the updates to qemu-char.c Ccing Dan whose commit that is... > I think clang is not doing something that gcc does implicitly? > > qemu-char.c:1843:26: error: use of undeclared identifier 'common' > chr = qemu_chr_alloc(common, errp); > ^ 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 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [FreeBSD] Build Failure, qemu-char.c 2016-01-22 16:47 ` Peter Maydell @ 2016-01-22 16:52 ` Sean Bruno 2016-01-22 17:02 ` Daniel P. Berrange 0 siblings, 1 reply; 5+ messages in thread From: Sean Bruno @ 2016-01-22 16:52 UTC (permalink / raw) To: Peter Maydell; +Cc: QEMU Developers -----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; } -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAEBCgBmBQJWol5RXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRCQUFENDYzMkU3MTIxREU4RDIwOTk3REQx MjAxRUZDQTFFNzI3RTY0AAoJEBIB78oecn5k8+IH/RRQP1AD8c+eNo4IcTUMIm8o voNYHPUgwYAfEyXPewJwyXHlZG5cMJ2rrxUue9WaXJ/TsyRtxhsAi3PLoJcXzTWE UvOZgZT3M6Xo0EcMy/PTf66Kc57/V7zrKxS5BDlBZp/yRCzrVkenmCmY/NjoqQq/ ZXPx7UpI5ec6debSalfwT67jboLJlvwhVibSR9/kAf0IbWQBFien9WC1RJmXvKJ2 Mk831symwxR8WaTeccP9tWytFC+CmHHqCssaSL7wkqmrwVKGDNrEDe7r6FftyY2a 3NPm8X3ahEkwE7m0fbNq03O3liw//reM8LRoyIKWQgA3M6pSYpXVGmwZXMpYA4I= =O8aP -----END PGP SIGNATURE----- ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [FreeBSD] Build Failure, qemu-char.c 2016-01-22 16:52 ` Sean Bruno @ 2016-01-22 17:02 ` Daniel P. Berrange 2016-01-22 17:16 ` Sean Bruno 0 siblings, 1 reply; 5+ messages in thread From: Daniel P. Berrange @ 2016-01-22 17:02 UTC (permalink / raw) To: Sean Bruno; +Cc: Peter Maydell, QEMU Developers 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 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; } If it solves it, i'll send a patch formally Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :| ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [FreeBSD] Build Failure, qemu-char.c 2016-01-22 17:02 ` Daniel P. Berrange @ 2016-01-22 17:16 ` Sean Bruno 0 siblings, 0 replies; 5+ messages in thread From: Sean Bruno @ 2016-01-22 17:16 UTC (permalink / raw) To: Daniel P. Berrange; +Cc: Peter Maydell, QEMU Developers -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 01/22/16 09:02, Daniel P. Berrange wrote: > 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 > > 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; } > > > If it solves it, i'll send a patch formally > > > Regards, Daniel > Yep, confirmed working/compiling with no warning. Thanks! sean -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAEBCgBmBQJWomP7XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRCQUFENDYzMkU3MTIxREU4RDIwOTk3REQx MjAxRUZDQTFFNzI3RTY0AAoJEBIB78oecn5knMwH/2jnh/+AVDDDlJVgNV6PiTWB +kaKO0B/22xGHsiUQNpvxjcnb03PH82XZ1XSyBdHpMWfWoLXIkXXi4vtf7On/008 jtMw7DNcInTdAsFLgQQlfmO7MnTnxaL93KpbR12eMLkau7/QRPxE+LSjeqHCHWMs tuH4i7Hgd4hfhYoWma8lBR3Jca7YOa882QLKoUPZ4+qt2G0WkvpkW95E3RFnLFvD M0bTTqk2E6oAKIps+Rbfu4/e2cpGygBk9m2ZcXWLXJKEQHeQ4Pn97ns15xWTDtn3 q0XIbEMqHRG7RVqm/V+fiKB4n4joSxDRD8MZEfGm6e9d7pJIQfz1ZIFmvpsiNcE= =vMv+ -----END PGP SIGNATURE----- ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-01-22 17:16 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-01-22 16:39 [Qemu-devel] [FreeBSD] Build Failure, qemu-char.c Sean Bruno 2016-01-22 16:47 ` Peter Maydell 2016-01-22 16:52 ` Sean Bruno 2016-01-22 17:02 ` Daniel P. Berrange 2016-01-22 17:16 ` Sean Bruno
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).