Using Macros
Karl Heuer
karl at haddock.ima.isc.com
Thu Aug 9 09:00:09 AEST 1990
In article <642 at travis.csd.harris.com> brad at SSD.CSD.HARRIS.COM (Brad Appleton) writes:
> #define CHECK(cond) ((cond) || exit(-1))
Won't work if exit() is properly declared as void. Try one of
#define CHECK(cond) ((cond) ? exit(-1) : (void)0)
#define CHECK(cond) ((cond) || (exit(-1), 0))
Karl W. Z. Heuer (karl at kelp.ima.isc.com or ima!kelp!karl), The Walking Lint
More information about the Comp.lang.c
mailing list