I can only repeat this - it depends on your application.
A good rule is to detect the error as early as possible. This usually makes it easier, faster, and cheaper to find and fix the problem. Ideally, you would catch this during development. As you noticed, you cannot catch it at compile time (unless you switch to the language of “design by contract” such as Eiffel), so you catch it at run time.
And then ... it depends ...
If this is a desktop application, then perhaps a huge dialog box and exit is the fastest way to fix it if it makes someone report an error. If possible, you might have the idea of sending an email to the developer (for example, if this is your own application).
If this is critical or vital, you just need to restart the application (this is a common approach in embedded systems).
No matter what you decide, try to collect as much information as possible about the problem. For example, you can flip your won macro to wrap around ASSERT, which adds FILE and LINE ).
I am using the following:
#ifdef TESTING #define ASSERT_MSG(subsystem, message, condition) if (!(condition)) {printf("Assert failed: \"%s\" at line %d in file \"%s\"\n", message, __LINE__, __FILE__); fflush(stdout); abort();} #define ASSERT_CONDITION(subsystem, condition) if (!(condition)) {printf("Assert failed: \%s\" at line %d in file \%s\"\n", #condition, __LINE__, __FILE__); fflush(stdout); abort();} #else #define ASSERT_MSG(subsystem, message, condition) if (!condition) DebugTrace(FATAL, subsystem, __FILE__, __LINE__, "%s", message); #define ASSERT_CONDITION(subsystem, condition) if (!(condition)) DebugTrace(FATAL, subsystem, __FILE__, __LINE__, "%s", #condition); #endif