Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When does GCC define NDEBUG? [duplicate]

Tags:

c++

gcc

Possible Duplicate:
Where does the -DNDEBUG normally come from?

I am using assertions in my code, but I don't know if they will trigger, because I don't know if NDEBUG is defined or not. Am I supposed to to specify the -DNDEBUG explicitly during compilation?

like image 884
StackedCrooked Avatar asked Jul 02 '10 15:07

StackedCrooked


1 Answers

Yes. GCC by itself does not set that flag. It is usually set by the makefile generator like Automake, CMake or QMake.

like image 122
Gianni Avatar answered Sep 27 '22 16:09

Gianni