From 066a378ca09ccc5d8074a942cf4bf1b9d4f40729 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Sat, 17 Oct 2026 10:04:54 +0000 Subject: fix(driver): default native output to .exe on Windows Without -o, cpsc saved test.out on every OS, which Windows cannot run directly. Use .exe under _WIN32 and keep .out elsewhere; update the manual and architecture notes accordingly. Co-Authored-By: Claude Sonnet 5.5 --- AGENTS/ARCH.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'AGENTS') diff --git a/AGENTS/ARCH.md b/AGENTS/ARCH.md index 5ddddc1..f85364b 100644 --- a/AGENTS/ARCH.md +++ b/AGENTS/ARCH.md @@ -43,7 +43,7 @@ The following commands use Debian/Ubuntu's versioned compiler names: cmake -S . -B build -DCPSC_RUN_MODE=EMBEDDED \ -DCMAKE_C_COMPILER=clang-23 -DCMAKE_CXX_COMPILER=clang++-23 cmake --build build -build/cpsc prog.cps # save prog.out beside the source +build/cpsc prog.cps # save prog.out (prog.exe on Windows) beside the source build/cpsc prog.cps -S # save prog.ll beside the source build/cpsc prog.cps -r # run without saving output build/cpsc prog.cps -r -S -o prog.ll # save IR, then run it @@ -104,7 +104,8 @@ Driver behavior (`tools/driver/main.cc`): verification. Diagnostics stay on stderr; source errors preserve existing output. Native linking uses a staged file beside the output and renames it on success. - `-S` selects textual IR; otherwise output is a native executable. Without `-o`, - replace the entry source extension with `.ll` or `.out` beside the source on every OS. + replace the entry source extension with `.ll`, or with `.exe` on Windows / `.out` elsewhere + for an executable, beside the source. `-o` paths are used literally and never select the format. `-r` alone saves nothing; either `-S` or `-o` requests saving before execution. - Lexer, Parser and CodeGen track error flags (`hadError()`); any error, including -- cgit v1.3.1-4-g156e