From 0305500e31eda6fe6da84f88748fc20843aebbce Mon Sep 17 00:00:00 2001 From: _ov4 Date: Sat, 17 Oct 2026 09:46:23 +0000 Subject: refactor(runtime): write runtime diagnostics with fprintf(stderr) Replace snprintf+write(2) with a single fprintf call on the platform's stderr: the C library's stderr / __stderrp, or __acrt_iob_func(2) on Windows, which the embedded runner binds to the host shim. Co-Authored-By: Claude Sonnet 5.5 --- include/cps/RuntimeCheck.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'include/cps/RuntimeCheck.h') diff --git a/include/cps/RuntimeCheck.h b/include/cps/RuntimeCheck.h index 8f33e99..30a1910 100644 --- a/include/cps/RuntimeCheck.h +++ b/include/cps/RuntimeCheck.h @@ -14,10 +14,9 @@ class RuntimeCheck { llvm::LLVMContext &TheContext; llvm::IRBuilder<> &Builder; - llvm::FunctionCallee SnprintfFunc; - llvm::FunctionCallee WriteFunc; - llvm::FunctionCallee StrLenFunc; - llvm::GlobalVariable *ErrBuf; + llvm::FunctionCallee FprintfFunc; + llvm::FunctionCallee StderrFunc; // Windows: __acrt_iob_func(2) + llvm::GlobalVariable *StderrVar; // elsewhere: the C library's stderr ExceptionHandler &Exceptions; llvm::Value *DivZeroMsg; llvm::Value *OutOfBoundsMsg; -- cgit v1.3.1-4-g156e