Logo

Programming-Idioms

History of Idiom 123 > diff from v16 to v17

Edit summary for version 17 by phrank:
New C implementation by user [phrank]

Version 16

2019-09-28, 12:21:42

Version 17

2019-09-28, 12:22:30

Idiom #123 Assert condition

Verify that predicate isConsistent returns true, otherwise report assertion violation.
Explain if the assertion is executed even in production environment or not.

Idiom #123 Assert condition

Verify that predicate isConsistent returns true, otherwise report assertion violation.
Explain if the assertion is executed even in production environment or not.

Imports
#include <assert.h>
Code
assert(isConsistent());
Comments bubble
If NDEBUG is defined, the assert macro becomes void. Therefore, such expressions must not have side effects.
Doc URL
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/assert.h.html