std1.0.0-beta-7 SafeC docs

Module assert

#include <std/assert.h> source

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_atAssert 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_assertAssert 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_trueAssert that cond is true; no message string required.

Macros

runtime_assert
assert_true