This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
how to run only when debugging
- From: "Manal Helal" <manalorama at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Sat, 13 Oct 2007 00:09:09 +0800
- Subject: how to run only when debugging
Hello
I am looking for an ANSI C preprocessor directive that can make code
run only when I am in debugging mode (compiled with gcc -g option), I
found something like:
#if DEBUG
Do this in debug;
#else
do this optionaly if not in debug
#endif
but it didn't work, as DEBUG is not defined,
I appreciate your help, and thank you in advance for that,
--
Kind Regards,
Manal