From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52383) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yi15n-00033z-3M for qemu-devel@nongnu.org; Tue, 14 Apr 2015 09:41:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yi15j-0000qc-Po for qemu-devel@nongnu.org; Tue, 14 Apr 2015 09:41:31 -0400 Received: from mail-ig0-f177.google.com ([209.85.213.177]:34678) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yi15j-0000qS-Jt for qemu-devel@nongnu.org; Tue, 14 Apr 2015 09:41:27 -0400 Received: by iget9 with SMTP id t9so75722183ige.1 for ; Tue, 14 Apr 2015 06:41:26 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20150414153808.4a069d93@thh440s> References: <1428523369-13700-1-git-send-email-peter.maydell@linaro.org> <20150414153808.4a069d93@thh440s> From: Peter Maydell Date: Tue, 14 Apr 2015 14:41:06 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] qga/commands-posix.c: Use correct types with g_base64_decode() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thomas Huth Cc: QEMU Developers , Michael Roth On 14 April 2015 at 14:38, Thomas Huth wrote: > Am Wed, 8 Apr 2015 21:02:49 +0100 > schrieb Peter Maydell : > >> 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_deco= de' 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 =E2=80=98gsize= *=E2=80=99 but argument is of type =E2=80=98size_t *=E2=80=99 >> >> (We previously fixed errors of this type in commit 3d1bba20.) >> >> Signed-off-by: Peter Maydell >> --- >> 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 *usern= ame, >> int status; >> int datafd[2] =3D { -1, -1 }; >> char *rawpasswddata =3D NULL; >> - size_t rawpasswdlen; >> + gsize rawpasswdlen; >> char *chpasswddata =3D NULL; >> size_t chpasswdlen; >> > > I've just ran into this issue as well on my x86 laptop when playing > around with "--extra-cflags=3D-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