GCC compiler command to display #ifdef

7

What compiler command do I use to display this line at runtime?

#ifdef DEBUG
    double tInicio_=clock() ;
#endif
    
asked by anonymous 02.07.2016 / 22:51

1 answer

5

Just use the -D directive on the GCC command line :

-D DEBUG

This will create a definition of DEBUG that will cause this #ifdef to be compiled and therefore will run when the application is called (of course, it depends on where this is used).

Other things need to be right in the code to work. But that does not know the question.

    
02.07.2016 / 23:06