K
Khookie
Hi everyone
The program I'm writing is getting bigger, hence not as easy to debug.
So I have this on one of my core header files, which I include in just
about every .c file, and I use it everywhere to print out diagnostic
msgs.
#ifdef NDEBUG
#define debug(x) ((void)0)
#else /* debugging enabled */
#define debug(e) fprintf(stderr, "%s (%d): %s\n", __FILE__, __LINE__,
e)
#endif
Hope it makes sense... the thing is, is there functionality like
selectively putting out diagnostic msgs already somewhere in standard
C? Or is this a case of roll your own?
Chris
The program I'm writing is getting bigger, hence not as easy to debug.
So I have this on one of my core header files, which I include in just
about every .c file, and I use it everywhere to print out diagnostic
msgs.
#ifdef NDEBUG
#define debug(x) ((void)0)
#else /* debugging enabled */
#define debug(e) fprintf(stderr, "%s (%d): %s\n", __FILE__, __LINE__,
e)
#endif
Hope it makes sense... the thing is, is there functionality like
selectively putting out diagnostic msgs already somewhere in standard
C? Or is this a case of roll your own?
Chris