You can change your ASSERT macro to:
#if defined (_DEBUG_) #define ASSERT assert #else #define ASSERT( exp ) ((void)(exp)) #endif
If an expression has no side effects, it should be optimized, but it should also suppress the warning (if the expression has side effects, then you will get different results in debug and non-debug builds that you also donโt want!).
source share