Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!uunet!aspect!dave From: dave@aspect.UUCP (Dave Corcoran) Newsgroups: comp.lang.c Subject: Re: Passing Variable Numbers of Arguments Summary: yapm4s Message-ID: <7630@aspect.UUCP> Date: 14 Feb 91 02:28:37 GMT References: <5196@media-lab.MEDIA.MIT.EDU> <1991Feb11.225815.5875@zoo.toronto.edu> <5270@awdprime.UUCP> Organization: Aspect Telecommunications, San Jose, Ca Lines: 25 In article <5270@awdprime.UUCP>, sanders@peyote.cactus.org (Tony Sanders) writes: > But I can't do this: > #ifdef NODEBUG > #define DP(fmt,...) /* sigh */ > #else > #define DP(fmt,...) fprintf(stderr,fmt,...); > #endif > > Any better ideas??? yet another posible m4 solution: ------------------8<---------------------------- define(DBP,`ifdef(`DEBUG',fprintf(stderr,$*))') DBP("not printed %d",1); ^ unfortunately this "gets through" in both cases define(`DEBUG') DBP("printed %d%d%d",1,23,4); DBP("so is this %s\n","string"); ------------------8<---------------------------- -- David Corcoran -@@ uunet!aspect!dave ~ In a society where anything goes eventually everything will.