[libvirt] [PATCH 1/3] build: avoid gcc preprocessor extensions

Jiri Denemark jdenemar at redhat.com
Wed May 11 20:31:30 UTC 2011


On Wed, May 11, 2011 at 14:13:28 -0600, Eric Blake wrote:
> Use of ',##__VA_ARGS__' is a gcc extension not guaranteed by
> C99; thankfully, we can avoid it by lumping the format argument
> into the var-args set.
> 
> * src/util/logging.h (VIR_DEBUG_INT, VIR_INFO_INT, VIR_WARN_INT)
> (VIR_ERROR_INT, VIR_DEBUG, VIR_INFO, VIR_WARN, VIR_ERROR): Stick
> to C99 var-arg macro syntax.
> * examples/domain-events/events-c/event-test.c (VIR_DEBUG):
> Simplify.
> ---
> 
> This one turned out to be much simpler than I was fearing; any
> time we guarantee that (fmt,...) expands to (fmt,##__VA_ARGS__),
> then we just use one fewer argument (...) expanding to (__VA_ARGS__).
> 
>  examples/domain-events/events-c/event-test.c |    3 +-
>  src/util/logging.h                           |   34 +++++++++++++-------------
>  2 files changed, 18 insertions(+), 19 deletions(-)

Nice and simple, ACK.

Jirka




More information about the libvir-list mailing list