qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] bswap: fix compiler warning


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH] bswap: fix compiler warning
Date: Fri, 12 Apr 2013 12:51:51 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5

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 powerpc64
> on x86_64 machine (gcc 4.6.3 from ftp.kernel.org, headers/libs from 
> FC18/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/libfdt.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 declaration 
> of function 'memcpy' [-Wimplicit-function-declaration]
> /home/alexey/qemu/include/qemu/bswap.h:244:5: warning: incompatible implicit 
> declaration of built-in function 'memcpy' [enabled by default]
> 
> Signed-off-by: Alexey Kardashevskiy <address@hidden>
> ---
>  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
>  
> +#include <string.h>
> +
>  #include "config-host.h"
>  #include <inttypes.h>
>  #include <limits.h>

Including string.h is certainly the right thing to do, but why do you
single it out first?

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

[Prev in Thread] Current Thread [Next in Thread]