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

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

 



On Wed, Jul 11, 2012 at 08:36:10AM -0600, Eric Blake wrote:
> On 07/11/2012 04:40 AM, 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.
> > ---
> >  cfg.mk             |    2 ++
> >  src/util/logging.h |    8 +++++++-
> >  2 files changed, 9 insertions(+), 1 deletion(-)
> 
> >  # else
> > +/**
> > + * virLogEatParam:
> > + *
> > + * Do nothing but eat parameters.
> > + */
> > +static inline void virLogEatParam(void *unused ATTRIBUTE_UNUSED, ...) {}
> 
> Can't we do:
> 
> static inline void virLogEatParam(void *dummy, ...) { dummy = dummy; }
> 
> to avoid even needing the ATTRIBUTE_UNUSED, and the syntax check exemption?

Good.

> 
> >  #  define VIR_DEBUG_INT(category, f, l, ...)    \
> > -    do { } while (0)
> > +    virLogEatParam((void*)category, f, l, __VA_ARGS__)
> 
> Any reason we have to use a cast, instead of just creating our eat
> function with the correct type parameter in the first place?

I just wanted to make the function more generic.


-- 
Thanks,
Hu Tao

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]