After macro expansion, your call to impureExpression()
no longer exists: it's not part of the macro expansion result. If the call to your function isn't there, the function won't be called, on all conforming implementations, at any optimisation level, as long as NDEBUG
is defined.
Note: you talk about NDEBUG == 0
, but if that is what you want the condition to be, your #ifdef NDEBUG
condition is incorrect. #ifdef
tests whether the macro is defined, and pays no attention to what the definition is.