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 --- AGENTS/PITFALLS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'AGENTS/PITFALLS.md') diff --git a/AGENTS/PITFALLS.md b/AGENTS/PITFALLS.md index d811ea4..951a2f6 100644 --- a/AGENTS/PITFALLS.md +++ b/AGENTS/PITFALLS.md @@ -121,7 +121,7 @@ test programs. ENDTRY. Bare THROW raises a new anonymous exception even inside CATCH; there is no rethrow syntax, error object or what(). Runtime checks are catchable; compiler errors are not. Runtime checks print the source line and error reason - to stdout before throwing, even when caught. Uncaught exceptions also print the + to stderr before throwing, even when caught. Uncaught exceptions also print the generic termination message and return 1. Bare THROW prints no diagnostic itself. Native binaries must link the C++ runtime with LLVM 23's `clang++` (`clang++-23` on Debian/Ubuntu). -- cgit v1.3.1-4-g156e