[libvirt] [PATCH 06/35] examples: use G_GNUC_UNUSED

Michal Privoznik mprivozn at redhat.com
Tue Oct 15 08:40:47 UTC 2019


On 10/14/19 3:15 PM, Ján Tomko wrote:
> Name the macro G_GNUC_UNUSED instead of ATTRIBUTE_UNUSED
> to match the rest of libvirt code.
> 
> Signed-off-by: Ján Tomko <jtomko at redhat.com>
> ---
>   examples/c/misc/event-test.c | 140 +++++++++++++++++------------------
>   1 file changed, 70 insertions(+), 70 deletions(-)
> 
> diff --git a/examples/c/misc/event-test.c b/examples/c/misc/event-test.c
> index fcf4492470..533b8da9bf 100644
> --- a/examples/c/misc/event-test.c
> +++ b/examples/c/misc/event-test.c
> @@ -21,17 +21,17 @@
>   # define verify(cond)
>   #endif
>   
> -#ifndef ATTRIBUTE_UNUSED
> -# define ATTRIBUTE_UNUSED __attribute__((__unused__))
> +#ifndef G_GNUC_UNUSED
> +# define G_GNUC_UNUSED __attribute__((__unused__))
>   #endif

Now, that we no longer use ATTRIBUTE_UNUSED - a private macro, can't we 
just #include <glib.h> here and drop this definition? This example is 
linked with glib anyways since it's linking with libvirt.so so we 
wouldn't be dragging in any dependency.

Michal




More information about the libvir-list mailing list