From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36105) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQhu6-0003oC-P3 for qemu-devel@nongnu.org; Fri, 12 Apr 2013 13:36:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQhu2-00070p-1Z for qemu-devel@nongnu.org; Fri, 12 Apr 2013 13:36:50 -0400 Received: from v220110690675601.yourvserver.net ([78.47.199.172]:38133) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQhu1-00070i-Rc for qemu-devel@nongnu.org; Fri, 12 Apr 2013 13:36:45 -0400 Message-ID: <51684621.7090204@weilnetz.de> Date: Fri, 12 Apr 2013 19:36:33 +0200 From: Stefan Weil MIME-Version: 1.0 References: <1365730875-22854-1-git-send-email-aik@ozlabs.ru> <5167E747.2020106@suse.de> <20130412164715.GL5065@truffula.fritz.box> In-Reply-To: <20130412164715.GL5065@truffula.fritz.box> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] bswap: fix compiler warning List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy Cc: Anthony Liguori , Stefan Hajnoczi , qemu-devel@nongnu.org, David Gibson , Blue Swirl , Paolo Bonzini , =?ISO-8859-1?Q?Andreas_F=E4rber?= , Richard Henderson Am 12.04.2013 18:47, schrieb David Gibson: > On Fri, Apr 12, 2013 at 12:51:51PM +0200, Andreas F=E4rber wrote: >> Am 12.04.2013 03:41, schrieb Alexey Kardashevskiy: >>> The bswap functions use memcpy but the bswap.h header itself does not= seem to >>> include it in some configuration such as cross compiling for powerpc6= 4 >>> on x86_64 machine (gcc 4.6.3 from ftp.kernel.org, headers/libs from F= C18/ppc64), >>> the example warning is below. >>> >>> The patch explicitly includes string.h. >>> >>> CC ppc64-softmmu/hw/virtio/virtio.o >>> In file included from /home/alexey/qemu/include/libfdt_env.h:22:0, >>> from /home/alexey/qemu/../lib4qemu/usr/include/libfd= t.h:54, >>> from /home/alexey/qemu/hw/nvram/spapr_nvram.c:25: >>> /home/alexey/qemu/include/qemu/bswap.h: In function 'lduw_p': >>> /home/alexey/qemu/include/qemu/bswap.h:244:5: warning: implicit decla= ration of function 'memcpy' [-Wimplicit-function-declaration] >>> /home/alexey/qemu/include/qemu/bswap.h:244:5: warning: incompatible i= mplicit declaration of built-in function 'memcpy' [enabled by default] >>> >>> Signed-off-by: Alexey Kardashevskiy >>> --- >>> include/qemu/bswap.h | 2 ++ >>> 1 file changed, 2 insertions(+) >>> >>> diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h >>> index d3af35d..d50de0d 100644 >>> --- a/include/qemu/bswap.h >>> +++ b/include/qemu/bswap.h >>> @@ -1,6 +1,8 @@ >>> #ifndef BSWAP_H >>> #define BSWAP_H >>> =20 >>> +#include >>> + >>> #include "config-host.h" >>> #include >>> #include >> Including string.h is certainly the right thing to do, but why do you >> single it out first? > Yeah, it probably shouldn't go above the config header. Otherwise > it's the right thing. If string.h went directly after limits.h, we'd even preserve the alphabetic order of the system headers :-)