3 ms·
assert only runs in debug mode anyway.
by Ono-Sendai 12y ago
assert only runs in debug mode anyway.
- haberman 12y agoIt runs unless NDEBUG is defined, which the author did not do according to his methodology. Anyway I looked at the assembly output and strlen() is optimized away.
- webreac 12y agoI really do not like when bad habits are encouraged by the optimizer.
- halayli 12y agono, that's not correct. http://pubs.opengroup.org/onlinepubs/009695399/functions/assert.html http://pubs.opengroup.org/onlinepubs/009695399/functions/ass...
- aidenn0 12y ago"Forcing a definition of the name NDEBUG, either from the compiler command line or with the preprocessor control statement #define NDEBUG ahead of the #include <assert.h> statement, shall stop assertions from being compiled into the program"