Xref: utzoo comp.std.c:385 comp.lang.c:12658 Path: utzoo!attcan!uunet!ingr!jones From: jones@ingr.UUCP (Mark Jones) Newsgroups: comp.std.c,comp.lang.c Subject: Re: Variable length arg lists for macros Message-ID: <2570@ingr.UUCP> Date: 16 Sep 88 15:56:13 GMT References: <438@ucsvc.unimelb.edu.au> <1036@cbnews.ATT.COM> <228@itivax.UUCP> <362@island.uu.net> Organization: Intergraph Corp. Huntsville, Al Lines: 34 In article <228@itivax.UUCP> scs@itivax.UUCP (Steve C. Simmons) writes: >In article <1036@cbnews.ATT.COM> lvc@cbnews.ATT.COM (Lawrence V. Cipriani) writes: >-In article <438@ucsvc.unimelb.edu.au>, u5565522@ucsvc.unimelb.edu.au (David Clunie) writes: >- >- #ifdef TRACE >- #define trace(anything) anything >- #else >- #define trace(anything) >- #endif >- > if ( x == m ) > trace( printf( "the consequences\n) ; ) > froob( some function ) ; > This produced rather different programs depending on the definition of 'trace'! Try rephrasing it as if(x == m) trace(printf("the consequences\n")); ^ ^ ^ This will evaluate to: if(x == m) ; or if(x == m) printf("the cosequences\n"); which will not affect the surrounding code.