NDEBUG is a preprocessing macro from <assert.h> that conventionally selects assertion behavior during compilation. When it is not defined, assert evaluates its Boolean expression whenever execution reaches it; a failed condition prints a diagnostic and calls abort. section 8.8
Debug versus production compilation
Assertions in gcd and gcd2 can expose false assumptions about variable values during debugging. Defining NDEBUG for the whole production compilation inhibits both the assertion expression and the abort call, so erroneous values no longer trigger those checks. section 8.8
assertion failed in file euclid.h, function gcd2(), line 6
A failed assertion can produce a diagnostic identifying the source file, function, and line before abort terminates execution. section 8.8
Because NDEBUG disables checking rather than merely hiding its output, define it consistently for an entire program or library, typically through the compiler command line rather than a local #define. section 8.8
