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

Re: [libvirt] [PATCHv3] fix failure when building with --disable-debug



On 13.07.2012 09:50, Hu Tao wrote:
> When building with --disable-debug, VIR_DEBUG expands to a nop.
> But parameters to VIR_DEBUG can be variables that are passed only
> to VIR_DEBUG. In the case the building system complains about unused
> variables.
> ---
>  src/util/logging.h |   15 ++++++++++++++-
>  1 file changed, 14 insertions(+), 1 deletion(-)
> 
> diff --git a/src/util/logging.h b/src/util/logging.h
> index 70318d0..2e70af4 100644
> --- a/src/util/logging.h
> +++ b/src/util/logging.h
> @@ -34,8 +34,21 @@
>  #  define VIR_DEBUG_INT(category, f, l, ...)                            \
>      virLogMessage(category, VIR_LOG_DEBUG, f, l, 0, __VA_ARGS__)
>  # else
> +/**
> + * virLogEatParam:
> + *
> + * Do nothing but eat parameters.
> + */
> +static inline void virLogEatParam(const char *category,
> +                                  const char *funcname,
> +                                  long long linenr, ...)
> +{
> +    category = category;
> +    funcname = funcname;
> +    linenr = linenr;
> +}
>  #  define VIR_DEBUG_INT(category, f, l, ...)    \
> -    do { } while (0)
> +    virLogEatParam(category, f, l, __VA_ARGS__)
>  # endif /* !ENABLE_DEBUG */
>  
>  # define VIR_INFO_INT(category, f, l, ...)                              \
> 

Okay, this fixes the issue. However I think virLogEatParam() should be
implemented in src/util/logging.c and in .h it should be only annotated.

Michal


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