[libvirt] [PATCH 6/6] Remove unused macros and enable -Wunused-macros

Eric Blake eblake at redhat.com
Mon Apr 4 20:54:28 UTC 2011


On 04/04/2011 10:20 AM, Daniel P. Berrange wrote:
> * m4/virt-compile-warnings.m4: Enable -Wunused-macros
> * daemon/libvirtd.c: Remove MAX_LISTEN
> * daemon/remote.c: Remote VIR_FROM_THIS

s/Remote/Remove/

>  33 files changed, 38 insertions(+), 108 deletions(-)

Nice ratio!

> +++ b/src/esx/esx_vi_methods.c
> @@ -1,4 +1,3 @@
> -
>  /*
>   * esx_vi_methods.c: client for the VMware VI API 2.5 to manage ESX hosts
>   *
> @@ -52,8 +51,10 @@
>  
>  
>  
> +#if 0
>  #define ESX_VI__METHOD__CHECK_OUTPUT__RequiredList                            \

Won't this cause 'make syntax-check' grief during cppi checks? (Multiple
instances)

> +++ b/tools/virsh.c
> @@ -409,15 +409,6 @@ _vshStrdup(vshControl *ctl, const char *s, const char *filename, int line)
>      exit(EXIT_FAILURE);
>  }
>  
> -/* Poison the raw allocating identifiers in favor of our vsh variants.  */
> -#undef malloc
> -#undef calloc
> -#undef realloc
> -#undef strdup
> -#define malloc use_vshMalloc_instead_of_malloc
> -#define calloc use_vshCalloc_instead_of_calloc
> -#define realloc use_vshRealloc_instead_of_realloc
> -#define strdup use_vshStrdup_instead_of_strdup

Hmm, I don't want to completely lose this.  Can we instead include
"warn-on-use.h" (already provided by gnulib) and do:

_GL_WARN_ON_USE(malloc, "use vshMalloc instead of malloc");

to get the same poisoning effects but via magic attributes rather than
unused macros?

-- 
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/20110404/d944ac5d/attachment-0001.sig>


More information about the libvir-list mailing list