From b4ffb2d9498560557821714e2d4651279dd6817c Mon Sep 17 00:00:00 2001 From: _ov4 Date: Wed, 21 Oct 2026 14:03:31 +0000 Subject: feat(diagnostics): print source diagnostics in gcc file:line: layout Lexer, parser, driver and codegen diagnostics now read ":: error: " instead of "error: at line N in ". The path is always printed as given on the command line. Call sites pass the bare message to cps::sourceError/sourceWarning, which carry printf format checking; reportError routes through the same helper. The suite iii harness parses the new layout and matches the reason against the message only. iii/template-class-pack-field passed only because its reason regex matched the case path, so it is now case-insensitive. Co-Authored-By: Claude Opus 5.5 --- doc/cpsc.1.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/cpsc.1.md b/doc/cpsc.1.md index 8359a25..b156d6f 100644 --- a/doc/cpsc.1.md +++ b/doc/cpsc.1.md @@ -117,7 +117,7 @@ An uncaught program exception returns 1 after printing `Unhandled exception. Pro # NOTES -Compiler diagnostics go to stderr. With multiple input files, lexer, parser and code generation diagnostics include the source path after the line number. Failed source compilation does not write output; failed native linking does not replace an existing output file. Successful compilation overwrites an existing output file, but an output path that refers to any input source file (including a symbolic or hard link) is rejected. Runtime diagnostics of the compiled program (for example `[Fatal] line N: ...` and `Unhandled exception. Program terminated.`) are also written to stderr, so `OUTPUT` text alone appears on stdout. +Compiler diagnostics go to stderr in the gcc layout `file:line: error: message`, where `file` is the source path as given on the command line; diagnostics that are not tied to a source file start with `cpsc:`. Failed source compilation does not write output; failed native linking does not replace an existing output file. Successful compilation overwrites an existing output file, but an output path that refers to any input source file (including a symbolic or hard link) is rejected. Runtime diagnostics of the compiled program (for example `[Fatal] line N: ...` and `Unhandled exception. Program terminated.`) are also written to stderr, so `OUTPUT` text alone appears on stdout. Missing input, including invoking `cpsc` without arguments, reports `cpsc: fatal error: no input files`. Ordinary lexical, syntax and semantic errors use `error:`; failures that prevent compilation, such as file I/O errors, use `fatal error:`. Compilation and argument failures end with one `compilation terminated.` line. Execution-stage failures do not print that line. -- cgit v1.3.1-4-g156e