|
|
|
|
|
by theseoafs
4555 days ago
|
|
To be fair, I don't see why you would have to throw your keyboard out the window. If I were debugging a source file and saw the same ASSERT macro on every other line, I would break out `grep` and track down the (extremely simple) definition so I could understand what it's doing. Moreover, returning with an error code is IMO entirely sane behavior for a macro with ASSERT in the name, especially considering halting execution of the program altogether generally isn't a good thing if you're writing a C library. |
|
http://www.cplusplus.com/reference/cassert/assert/
Quote from the link: Therefore, this macro is designed to capture programming errors, not user or run-time errors, since it is generally disabled after a program exits its debugging phase.
Of course you can name your macro whatever you want, even assert, but it will confuse other developers used to c library functions.