Q:

C - How to use macro to leave out assert()'s in production release

my question might be partially related to When should we use asserts in C?  But I'm still wondering which would be a better practice when I have a project with a bunch of assertions spread out at places:
Do I use the DNDEBUG flag to turn asserts into no-ops (as suggested in the related question), or do I surround all the asserts with a if macro like
#ifdef TEST
#include <assert.h>
#endif

....

#ifdef TEST
    assert(...);
#endif

....

and use a -D TEST option at compliation time?  Is there some sort of standard or 'convention' on this?  I feel like the latter would be neater.. 
Thanks! 

A:

Is there some sort of standard or 'convention' on this? 

Yes: define NDEBUG in production code.  It's the ISO C standard way of doing this and only adds a few milliseconds to your compile cycle (or saves some compared to not defining NDEBUG, as you're including it anyway) because the compiler/preprocessor has to scan through <assert.h> to find out it has to remove things from your code.  It doesn't bloat your executable or add any other kind of runtime overhead, unless you do crazy things in a #ifndef NDEBUG block.