This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]