qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 13/18] nvdimm: build namespace config data


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH v2 13/18] nvdimm: build namespace config data
Date: Tue, 25 Aug 2015 17:16:28 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

On Fri, Aug 14, 2015 at 10:52:06PM +0800, Xiao Guangrong wrote:
> +#ifdef NVDIMM_DEBUG
> +#define nvdebug(fmt, ...) fprintf(stderr, "nvdimm: " fmt, ## __VA_ARGS__)
> +#else
> +#define nvdebug(...)
> +#endif

The following allows the compiler to check format strings and syntax
check the argument expressions:

#define NVDIMM_DEBUG 0  /* set to 1 for debug output */
#define nvdebug(fmt, ...) \
    if (NVDIMM_DEBUG) { \
        fprintf(stderr, "nvdimm: " fmt, ## __VA_ARGS__); \
    }

This approach avoids bitrot (e.g. debug format string arguments have
become outdated).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]