From: Peter Maydell <peter.maydell@linaro.org>
To: Thomas Huth <thuth@redhat.com>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
Michael Roth <mdroth@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH] qga/commands-posix.c: Use correct types with g_base64_decode()
Date: Tue, 14 Apr 2015 14:41:06 +0100 [thread overview]
Message-ID: <CAFEAcA8DL7=RaAt9HyNLWroPNs9+detW0c-VhaTZ2TqyPD2v-g@mail.gmail.com> (raw)
In-Reply-To: <20150414153808.4a069d93@thh440s>
On 14 April 2015 at 14:38, Thomas Huth <thuth@redhat.com> wrote:
> Am Wed, 8 Apr 2015 21:02:49 +0100
> schrieb Peter Maydell <peter.maydell@linaro.org>:
>
>> The second argument of g_base64_decode() is a 'gsize *', not a
>> 'size_t *'. Some compilation environments (like building 32-bit PPC
>> binaries on a PPC64 system) will complain about the mismatch:
>>
>> CC qga/commands-posix.o
>> qga/commands-posix.c: In function 'qmp_guest_set_user_password':
>> qga/commands-posix.c:1908:5: error: passing argument 2 of 'g_base64_decode' from incompatible pointer type [-Werror]
>> In file included from /usr/include/glib-2.0/glib.h:37:0,
>> from qga/commands-posix.c:14:
>> /usr/include/glib-2.0/glib/gbase64.h:49:9: note: expected ‘gsize *’ but argument is of type ‘size_t *’
>>
>> (We previously fixed errors of this type in commit 3d1bba20.)
>>
>> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
>> ---
>> qga/commands-posix.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/qga/commands-posix.c b/qga/commands-posix.c
>> index ba8de62..9fde348 100644
>> --- a/qga/commands-posix.c
>> +++ b/qga/commands-posix.c
>> @@ -1901,7 +1901,7 @@ void qmp_guest_set_user_password(const char *username,
>> int status;
>> int datafd[2] = { -1, -1 };
>> char *rawpasswddata = NULL;
>> - size_t rawpasswdlen;
>> + gsize rawpasswdlen;
>> char *chpasswddata = NULL;
>> size_t chpasswdlen;
>>
>
> I've just ran into this issue as well on my x86 laptop when playing
> around with "--extra-cflags=-m32"... so should this be fixed for the
> 2.3 release already? I didn't spot your patch on the master branch
> yet...
No, this is not-for-2.3. I think that the issue here is that
merely adding -m32 isn't sufficient, because pkg-config when
run by configure will end up pointing at a bunch of incorrect
glib includes (for x86-64, not i386). So the actual solution
is to give configure the right pkg-config, and then gsize and
size_t are the same. There's a patch by John Snow for
configure on-list for that.
-- PMM
next prev parent reply other threads:[~2015-04-14 13:41 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-08 20:02 [Qemu-devel] [PATCH] qga/commands-posix.c: Use correct types with g_base64_decode() Peter Maydell
2015-04-08 20:14 ` Michael Roth
2015-04-14 13:38 ` Thomas Huth
2015-04-14 13:41 ` Peter Maydell [this message]
2015-04-14 14:30 ` Paolo Bonzini
2015-04-14 13:42 ` Paolo Bonzini
2015-04-14 13:45 ` Peter Maydell
2015-04-14 14:29 ` Paolo Bonzini
2015-04-14 14:35 ` Eric Blake
2015-04-14 14:50 ` Paolo Bonzini
2015-04-14 15:12 ` Eric Blake
2015-04-14 14:36 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAFEAcA8DL7=RaAt9HyNLWroPNs9+detW0c-VhaTZ2TqyPD2v-g@mail.gmail.com' \
--to=peter.maydell@linaro.org \
--cc=mdroth@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).