Module assert
Runtime assertions (C89–C23)
SafeC has compile-time static_assert as a built-in keyword.
This module provides runtime assertion with file/line diagnostics.
Functions
| runtime_assert_at | Assert that cond is true at runtime, reporting the given location.
On failure: prints "Assertion failed: <msg> at <file>:<line>" to stderr
and calls abort(). Pass FILE and LINE for the call site: |
| runtime_assert | Assert that cond is true; on failure prints "Assertion failed: <msg>"
and aborts. A function can't learn its caller's file/line, so these
report no location — in compat mode (--compat-preprocessor) the macros
below route them through runtime_assert_at with the caller's location. |
| assert_true | Assert that cond is true; no message string required. |
Macros
| runtime_assert | |
| assert_true |