[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] qga/commands-posix.c: Use correct types with g_
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH] qga/commands-posix.c: Use correct types with g_base64_decode() |
Date: |
Tue, 14 Apr 2015 15:42:24 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 |
On 08/04/2015 22:02, Peter Maydell wrote:
> 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 <address@hidden>
I think this patch is wrong. Considering what Thomas was doing
("playing around with --extra-cflags=-m32" on x86) this looks like
you're using the 64-bit glib headers while doing a 32-bit compilation.
Paolo
> ---
> 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;
>
>