aboutsummaryrefslogtreecommitdiff
path: root/doc/language/function/cpsc-function-realloc.7.md
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-17 09:35:19 +0000
committer_ov4 <ov4@ov4.org>2026-10-17 09:35:19 +0000
commit6b332f91c82da6e19efad92b58ac1d9c1bc9eec0 (patch)
treea553b6aab0589dd7cafe5b2508cb274ac0ae9e98 /doc/language/function/cpsc-function-realloc.7.md
parentb25cbba212354e44921d23490765782f61787bc8 (diff)
feat(runtime): write runtime diagnostics to stderr
Runtime check messages and the unhandled-exception message were printed to stdout by the generated program, so `cpsc x.cps -r >out.txt` captured them. They are now formatted with snprintf and written with write(2). Test expectations and docs are updated accordingly. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Diffstat (limited to 'doc/language/function/cpsc-function-realloc.7.md')
-rw-r--r--doc/language/function/cpsc-function-realloc.7.md2
1 files changed, 1 insertions, 1 deletions
diff --git a/doc/language/function/cpsc-function-realloc.7.md b/doc/language/function/cpsc-function-realloc.7.md
index 19fcfdf..dc2d61f 100644
--- a/doc/language/function/cpsc-function-realloc.7.md
+++ b/doc/language/function/cpsc-function-realloc.7.md
@@ -14,7 +14,7 @@ REALLOC(pointer, bytes)
REALLOC is a compiler extension returning C `void*`. The pointer argument must also be C `void*`; explicitly cast other pointer types. The size accepts INTEGER or a C integer and converts to host size_t, just as MALLOC does.
-A null pointer behaves as MALLOC(bytes). A non-null pointer must start an active explicit MALLOC or REALLOC allocation, even when bytes is zero. Invalid addresses print the source line and reason to stdout and throw an anonymous exception before touching the memory or allocation record.
+A null pointer behaves as MALLOC(bytes). A non-null pointer must start an active explicit MALLOC or REALLOC allocation, even when bytes is zero. Invalid addresses print the source line and reason to stderr and throw an anonymous exception before touching the memory or allocation record.
For a valid pointer and zero bytes, REALLOC releases the block and returns null. This rule is independent of libc's zero-size behavior. For a nonzero size, successful resizing preserves the smaller of the old and new sizes; added bytes are uninitialized. The returned address may differ from the input. Use the returned pointer afterward; previous aliases must not be used.