Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!ncar!groucho!steve From: steve@groucho.ucar.edu (Steve Emmerson) Newsgroups: comp.lang.c Subject: Re: #define DEBUG... (using printf for debugging) Message-ID: <7277@ncar.ucar.edu> Date: 9 May 90 18:33:30 GMT References: <1990May8.133742.10584@eci386.uucp> Sender: news@ncar.ucar.edu Organization: University Corporation for Atmospheric Research (UCAR) Lines: 21 jmm@eci386.uucp (John Macdonald) writes: >Try the following instead: > #ifdef DEBUG_PRINT_ON > # define DEBUG printf > #else > # define DEBUG(ignore) > #endif >To insert a DEBUG-conditional printf use: > DEBUG( "format", args, ... ); >(no double parens or other funny syntax required, it just looks like >a function call) Be aware that some C compilers will have problems with the above due to an "argument mismatch" between the usage of the macro and its definition. Steve Emmerson steve@unidata.ucar.edu ...!ncar!unidata!steve