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

Re: [Linux-cluster] [PATCH 0/4] fence



On Fri, 2005-02-18 at 13:28 -0500, Lon Hohberger wrote:
> On Fri, 2005-02-18 at 12:01 +0800, David Teigland wrote:
> 
> > For reference, existing:
> > 
> > #define die(fmt, args...) \
> > do \
> > { \
> > 	fprintf(stderr, "%s: ", prog_name); \
> > 	fprintf(stderr, fmt "\n", ##args); \
> > 	syslog(LOG_ERR, fmt, ##args); \
> > 	exit(EXIT_FAILURE); \
> > } \
> > while (0)

Side note:

#define die(fmt, ...) \
do \
{ \
	fprintf(stderr, "%s: ", prog_name); \
	fprintf(stderr, fmt "\n", __VA_ARGS__); \
	syslog(LOG_ERR, fmt, __VA_ARGS__); \
	exit(EXIT_FAILURE); \
}\
while (0)

...is functionally equivalent, is ISO-C99 compliant (as to opposed to a
"GNUism"), and does not rely on the compiler actually successfully
inlining anything.

-- Lon


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