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

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

 



On 07/13/2012 01:50 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.
> ---
>  src/util/logging.h |   15 ++++++++++++++-
>  1 file changed, 14 insertions(+), 1 deletion(-)

ACK.

> 
> 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, ...)

Technically, we don't even need that many variables.  I simplified this
and pushed:

diff --git i/src/util/logging.h w/src/util/logging.h
index 2e70af4..db648cb 100644
--- i/src/util/logging.h
+++ w/src/util/logging.h
@@ -1,7 +1,7 @@
 /*
  * logging.h: internal logging and debugging
  *
- * Copyright (C) 2006-2008, 2011 Red Hat, Inc.
+ * Copyright (C) 2006-2008, 2011-2012 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -35,20 +35,17 @@
     virLogMessage(category, VIR_LOG_DEBUG, f, l, 0, __VA_ARGS__)
 # else
 /**
- * virLogEatParam:
+ * virLogEatParams:
  *
  * Do nothing but eat parameters.
  */
-static inline void virLogEatParam(const char *category,
-                                  const char *funcname,
-                                  long long linenr, ...)
+static inline void virLogEatParams(const char *unused, ...)
 {
-    category = category;
-    funcname = funcname;
-    linenr = linenr;
+    /* Silence gcc */
+    unused = unused;
 }
 #  define VIR_DEBUG_INT(category, f, l, ...)    \
-    virLogEatParam(category, f, l, __VA_ARGS__)
+    virLogEatParams(category, f, l, __VA_ARGS__)
 # endif /* !ENABLE_DEBUG */

 # define VIR_INFO_INT(category, f, l, ...)                              \

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
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]