#defines with variable # arguments

Ed Gould ed at mtxinu.UUCP
Wed May 18 04:03:14 AEST 1988


>If you do 
>
>#define Dprintf	if(Debug) printf
>
>you don't get any warnings; you do get possible dangling else problems. 

To avoid the dangling-else problem, use

	#define	Dprintf	if(Debug == 0); else printf

for the same effect.

-- 
Ed Gould                    mt Xinu, 2560 Ninth St., Berkeley, CA  94710  USA
{ucbvax,uunet}!mtxinu!ed    +1 415 644 0146

"I'll fight them as a woman, not a lady.  I'll fight them as an engineer."



More information about the Comp.unix.wizards mailing list