Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!adm!TGMIKEY%CALSTATE.BITNET@wiscvm.wisc.EDU From: TGMIKEY%CALSTATE.BITNET@wiscvm.wisc.EDU (Account Manager) Newsgroups: comp.lang.c Subject: RE: Re: How can I use #define to make something completely disappear? Message-ID: <10320@brl-adm.ARPA> Date: Fri, 13-Nov-87 13:56:16 EST Article-I.D.: brl-adm.10320 Posted: Fri Nov 13 13:56:16 1987 Date-Received: Sun, 15-Nov-87 09:35:54 EST Sender: news@brl-adm.ARPA Lines: 61 Received: by CALSTATE via BITNet with NJF for TGMIKEY@CALSTATE; Comment: 10 Nov 87 05:05:16 PST Received: by BYUADMIN (Mailer X1.24) id 3809; Tue, 10 Nov 87 06:04:44 MST Date: 31 Oct 87 12:30:44 GMT Reply-To: Info-C@BRL.ARPA Sender: INFO-C@NDSUVM1 From: ljz@fxgrp.uucp Subject: Re: How can I use #define to make something completely disappear? Comments: To: info-c@brl-smoke.arpa To: TGMIKEY@CCS.CSUSCC.CALSTATE.EDU In article <10083@brl-adm.ARPA> ultra!wayne@ames.arpa (Wayne Hathaway) writes: > >Anybody got any suggestions? [ about how to conditionally comment out printf] How 'bout ... #ifdef DEBUG # define D(X) X #else # define D(X) #endif Then, in your program you can have ... D(printf("%s %s %d %d %g\n", foo, bar, baz, furd, farkle)); The double parens are a bit unaesthetic to me, but this gets the job done. Another variation ... #ifdef DEBUG # define dprintf(X) printf X #else # define dprintf(X) #endif Then, in your program ... dprintf(("%s %s %d %d %g\n", foo, bar, baz, furd, farkle)); More double parens, but it works. You can get fancy with if statements, testing of debug flags, etc., but I think you get the idea. -- Lloyd Zusman, Master Byte Software, Los Gatos, California "We take things well in hand." ..!ames!fxgrp!ljz ===== Reply from Mike Khosraviani ========================== We are trying to get rid of paranthesis (C is not considered an artificial language program yet) LISP uses them enought, thank you!!!! If you wonder if I have any better suggestions or NOT, the answer is NOT!!!! So, I guess we have to put up with those ('s. Mike