source: tags/cvs_2_svn/TEMPLATES/arb_debug.h

Last change on this file was 4596, checked in by westram, 17 years ago
  • valgrind helper function
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.3 KB
Line 
1// =============================================================== //
2//                                                                 //
3//   File      : arb_debug.h                                       //
4//   Purpose   : some debugging tools                              //
5//   Time-stamp: <Fri May/18/2007 16:12 MET Coder@ReallySoft.de>   //
6//                                                                 //
7//   Coded by Ralf Westram (coder@reallysoft.de) in May 2007       //
8//   Institute of Microbiology (Technical University Munich)       //
9//   http://www.arb-home.de/                                       //
10//                                                                 //
11// =============================================================== //
12#ifndef ARB_DEBUG_H
13#define ARB_DEBUG_H
14
15#if defined(DEBUG)
16
17// if you get the valgrind warning
18// "Conditional jump or move depends on uninitialised value"
19// for a complex statement, use the following macro to find out
20// which part of the statement is the cause.
21
22#define TEST_INITIALIZED(expr) do {             \
23        if (expr) printf("0");                  \
24        else printf("1");                       \
25    } while(0)
26
27#else
28
29#define TEST_INITIALIZED(expr) { int TEST_INITIALIZED; } // create a warning
30
31#endif // DEBUG
32
33#else
34#error arb_debug.h included twice
35#endif // ARB_DEBUG_H
36
Note: See TracBrowser for help on using the repository browser.