[libvirt] [PATCH] Fix conflicts with glibc globals

Eric Blake eblake at redhat.com
Thu Feb 3 15:58:11 UTC 2011


On 02/03/2011 08:09 AM, Davidlohr Bueso wrote:
> When compiling libvirt with GCC 3.4.6 the following warning is being triggered quite a lot:
> 
> util/memory.h:60: warning: declaration of 'remove' shadows a global declaration
> /usr/include/stdio.h:175: warning: shadowed declaration is here
> 
> Fix this by renaming the parameter to 'toremove'.
> ---
>  src/util/memory.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/src/util/memory.h b/src/util/memory.h
> index 750a6b0..66b4c42 100644
> --- a/src/util/memory.h
> +++ b/src/util/memory.h
> @@ -57,7 +57,7 @@ int virExpandN(void *ptrptr, size_t size, size_t *count, size_t add)
>  int virResizeN(void *ptrptr, size_t size, size_t *alloc, size_t count,
>                 size_t desired)
>      ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3);
> -void virShrinkN(void *ptrptr, size_t size, size_t *count, size_t remove)
> +void virShrinkN(void *ptrptr, size_t size, size_t *count, size_t toremove)

What a pain.  But obviously correct fix (it matches the same change that
had been made earlier to the .c counterpart); ACK and pushed along with
an AUTHORS update to keep 'make syntax-check' happy.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110203/ec0a8ed3/attachment-0001.sig>


More information about the libvir-list mailing list