From 6b332f91c82da6e19efad92b58ac1d9c1bc9eec0 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Sat, 17 Oct 2026 09:35:19 +0000 Subject: 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 --- tests/i/memory-reallocation/expected-stderr.txt | 6 ++++++ tests/i/memory-reallocation/expected.txt | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) create mode 100644 tests/i/memory-reallocation/expected-stderr.txt (limited to 'tests/i/memory-reallocation') diff --git a/tests/i/memory-reallocation/expected-stderr.txt b/tests/i/memory-reallocation/expected-stderr.txt new file mode 100644 index 0000000..5478518 --- /dev/null +++ b/tests/i/memory-reallocation/expected-stderr.txt @@ -0,0 +1,6 @@ +[Fatal] line 28: Memory allocation failed +[Fatal] line 40: Invalid memory address (not an active allocation) +[Fatal] line 47: Invalid memory address (not an active allocation) +[Fatal] line 63: Invalid memory address (not an active allocation) +[Fatal] line 69: Invalid memory address (not an active allocation) +[Fatal] line 77: Invalid memory address (not an active allocation) diff --git a/tests/i/memory-reallocation/expected.txt b/tests/i/memory-reallocation/expected.txt index 9e9ccc9..bb43f4f 100644 --- a/tests/i/memory-reallocation/expected.txt +++ b/tests/i/memory-reallocation/expected.txt @@ -1,17 +1,11 @@ TRUE 12:34 12 -[Fatal] line 28: Memory allocation failed preserved:12 56 TRUE -[Fatal] line 40: Invalid memory address (not an active allocation) released address caught -[Fatal] line 47: Invalid memory address (not an active allocation) invalid zero resize caught 71 -[Fatal] line 63: Invalid memory address (not an active allocation) -[Fatal] line 69: Invalid memory address (not an active allocation) nested catch -[Fatal] line 77: Invalid memory address (not an active allocation) internal buffer caught -- cgit v1.3.1-4-g156e