From 5e43ece57854ad89dbeb42450888209d0e5e7b2c Mon Sep 17 00:00:00 2001 From: Rangi <35663410+Rangi42@users.noreply.github.com> Date: Wed, 9 Jul 2025 11:04:23 -0400 Subject: [PATCH] Remove `errx` and errors.hpp (#1737) --- Makefile | 21 +++-- include/asm/fstack.hpp | 2 +- include/asm/lexer.hpp | 2 +- include/asm/warning.hpp | 2 +- include/diagnostics.hpp | 4 +- include/error.hpp | 12 --- include/link/warning.hpp | 8 ++ src/CMakeLists.txt | 11 +-- src/asm/fstack.cpp | 29 +++---- src/asm/lexer.cpp | 21 +++-- src/asm/main.cpp | 35 ++++---- src/asm/output.cpp | 8 +- src/asm/parser.y | 22 ++--- src/asm/rpn.cpp | 6 +- src/asm/section.cpp | 14 ++-- src/asm/symbol.cpp | 8 +- src/asm/warning.cpp | 28 ++++--- src/diagnostics.cpp | 9 +++ src/error.cpp | 29 ------- src/fix/main.cpp | 2 +- src/gfx/main.cpp | 2 +- src/gfx/pal_spec.cpp | 2 +- src/gfx/process.cpp | 2 +- src/gfx/reverse.cpp | 2 +- src/link/assign.cpp | 8 +- src/link/main.cpp | 2 +- src/link/object.cpp | 34 +++----- src/link/output.cpp | 12 +-- src/link/script.y | 4 +- src/link/section.cpp | 27 +------ src/link/warning.cpp | 81 +++++++++++++------ test/asm/align-large-ofs.err | 2 +- test/asm/align-large.err | 2 +- test/asm/align-offset.err | 2 +- test/asm/align-pc-outside-section.err | 2 +- test/asm/align-unattainable.err | 2 +- test/asm/anon-label-bad.err | 2 +- test/asm/assert-nosect-bank.err | 2 +- test/asm/assert@-no-sect.err | 2 +- test/asm/bank.err | 2 +- test/asm/block-comment-termination-error.err | 2 +- test/asm/bracketed-macro-args.err | 2 +- test/asm/bracketed-symbols.err | 2 +- test/asm/builtin-overwrite.err | 2 +- test/asm/builtin-reserved.err | 2 +- test/asm/character-escape-at-end.err | 2 +- test/asm/character-escapes.err | 2 +- test/asm/charmap-empty.err | 2 +- test/asm/charmap-inheritance.err | 2 +- test/asm/charsize.err | 2 +- test/asm/charval.err | 2 +- test/asm/code-after-endm-endr-endc.err | 2 +- test/asm/command-line-symbols.err | 2 +- test/asm/compound-assignment.err | 2 +- test/asm/const-and.err | 2 +- test/asm/const-not.err | 2 +- test/asm/const-zero.err | 2 +- test/asm/data-in-ram.err | 2 +- test/asm/def-scoped.err | 2 +- test/asm/def.err | 2 +- test/asm/diff-marks.err | 2 +- test/asm/double-purge.err | 2 +- test/asm/ds-bad.err | 2 +- test/asm/empty-raw-identifier.err | 2 +- test/asm/endsection-in-load.err | 2 +- test/asm/endsection.err | 2 +- test/asm/error-limit.err | 2 +- test/asm/error-recovery.err | 2 +- test/asm/expand-empty-string.err | 2 +- test/asm/export.err | 2 +- test/asm/ff00+c-bad.err | 2 +- test/asm/fixed-oob.err | 2 +- test/asm/fixed-point-precision.err | 2 +- test/asm/for-loop-variable.err | 2 +- test/asm/format-truncation.err | 2 +- test/asm/fragment-align.err | 2 +- test/asm/garbage_char.err | 2 +- test/asm/garbage_sequence.err | 2 +- test/asm/impossible-bank.err | 2 +- test/asm/incbin-empty-bad.err | 2 +- test/asm/incbin-end-0.err | 2 +- test/asm/incbin-end-bad.err | 2 +- test/asm/interpolation-overflow.err | 2 +- test/asm/interpolation.err | 2 +- test/asm/invalid-alignment.err | 2 +- test/asm/invalid-bank.err | 2 +- test/asm/invalid-empty-macro-arg.err | 2 +- test/asm/invalid-format.err | 2 +- test/asm/invalid-instructions.err | 2 +- test/asm/invalid-jr.err | 2 +- test/asm/invalid-macro-arg-character.err | 2 +- test/asm/invalid-macro-arg-symbol.err | 2 +- test/asm/invalid-numbers.err | 2 +- test/asm/invalid-opt.err | 2 +- test/asm/invalid-union.err | 2 +- test/asm/invalid-utf-8-strings.err | 2 +- test/asm/invalid-utf-8.err | 2 +- test/asm/isconst.err | 2 +- test/asm/label-diff.err | 2 +- test/asm/label-macro-arg.err | 2 +- test/asm/label-outside-section.err | 2 +- test/asm/label-redefinition.err | 2 +- test/asm/label-scope.err | 2 +- test/asm/lexer-hack.err | 2 +- test/asm/line-continuation-whitespace.err | 2 +- test/asm/line-continuation.err | 2 +- test/asm/load-in-load.err | 2 +- test/asm/load-overflow.err | 2 +- test/asm/load-rom.err | 2 +- test/asm/local-purge.err | 2 +- test/asm/macro-@.err | 2 +- test/asm/macro-arg-0.err | 2 +- test/asm/macro-arg-illegal-escape.err | 2 +- test/asm/macro-arg-in-string.err | 2 +- test/asm/macro-args-outside-macro.err | 2 +- test/asm/macro-syntax.err | 2 +- test/asm/max-errors.err | 2 +- test/asm/multi-line-strings.err | 2 +- test/asm/multiple-charmaps.err | 2 +- test/asm/negative-macro-args.err | 2 +- test/asm/nested-bad-interpolation.err | 2 +- test/asm/nested-brackets.err | 2 +- test/asm/nested-expansions.err | 2 +- test/asm/nested-macrodef.err | 2 +- test/asm/non-numeric-symbol.err | 2 +- test/asm/nonexist-include.err | 2 +- test/asm/notexist.err | 5 +- test/asm/null-in-macro.err | 2 +- test/asm/null-outside-string.err | 2 +- test/asm/opt-Q.err | 2 +- test/asm/pc-bank.err | 2 +- test/asm/pops-restore-no-section.err | 2 +- test/asm/purge-ref.err | 2 +- test/asm/purge-refs.err | 2 +- test/asm/purge.err | 2 +- test/asm/pushs.err | 2 +- test/asm/raw-macro-args.err | 2 +- test/asm/raw-string-symbol-errors.err | 2 +- test/asm/redef-equ.err | 2 +- test/asm/redef-equs.err | 2 +- test/asm/ref-override-bad.err | 2 +- test/asm/reference-undefined-equs.err | 2 +- test/asm/rept-shift.err | 2 +- test/asm/revchar.err | 2 +- test/asm/rs-overwrite.err | 2 +- test/asm/section-in-load.err | 2 +- test/asm/section-sizeof-startof.err | 2 +- test/asm/shift-outside-macro.err | 2 +- test/asm/skip-expansions.err | 2 +- test/asm/strfmt.err | 2 +- test/asm/string-concat.err | 2 +- test/asm/string-literal-macro-arg.err | 2 +- test/asm/sym-collision.err | 2 +- test/asm/symbol-invalid-macro-arg.err | 2 +- test/asm/symbol-override.err | 2 +- test/asm/syntax-error-after-syntax-error.err | 2 +- test/asm/syntax-error-eof-newline.err | 2 +- test/asm/syntax-error-lexer-mode.err | 2 +- test/asm/syntax-error.err | 2 +- test/asm/undefined-builtins.err | 2 +- test/asm/undefined-opt.err | 2 +- test/asm/union-in-rom.err | 2 +- test/asm/unique-id.err | 2 +- test/asm/unterminated-rept.err | 2 +- test/asm/use-label-outside-section.err | 2 +- test/link/assert.out | 2 +- test/link/cascading-errors-fatal-assert.out | 2 +- test/link/romx-tiny-no-t.out | 3 +- test/link/romx-tiny-t.out | 3 +- test/link/section-union/assert.out | 2 +- test/link/section-union/data-overlay.out | 3 +- test/link/section-union/different-data.out | 3 +- test/link/section-union/different-size.out | 3 +- .../link/section-union/different-syntaxes.out | 3 +- test/link/section-union/no-room.out | 3 +- test/link/section-union/split-data.out | 3 +- test/link/vram-floating-dmg-mode-d.out | 3 +- test/link/wramx-dmg-mode-d.out | 3 +- test/link/wramx-dmg-mode-no-d.out | 3 +- 179 files changed, 366 insertions(+), 393 deletions(-) delete mode 100644 include/error.hpp delete mode 100644 src/error.cpp diff --git a/Makefile b/Makefile index a171b211..7e28de2f 100644 --- a/Makefile +++ b/Makefile @@ -49,7 +49,12 @@ BASE_REF := origin/master all: rgbasm rgblink rgbfix rgbgfx +common_obj := \ + src/extern/getopt.o \ + src/diagnostics.o + rgbasm_obj := \ + ${common_obj} \ src/asm/charmap.o \ src/asm/fixpoint.o \ src/asm/format.o \ @@ -64,10 +69,7 @@ rgbasm_obj := \ src/asm/section.o \ src/asm/symbol.o \ src/asm/warning.o \ - src/extern/getopt.o \ src/extern/utf8decoder.o \ - src/diagnostics.o \ - src/error.o \ src/linkdefs.o \ src/opmath.o \ src/util.o @@ -75,6 +77,7 @@ rgbasm_obj := \ src/asm/lexer.o src/asm/main.o: src/asm/parser.hpp rgblink_obj := \ + ${common_obj} \ src/link/assign.o \ src/link/main.o \ src/link/object.o \ @@ -85,9 +88,7 @@ rgblink_obj := \ src/link/section.o \ src/link/symbol.o \ src/link/warning.o \ - src/extern/getopt.o \ src/extern/utf8decoder.o \ - src/error.o \ src/linkdefs.o \ src/opmath.o \ src/util.o @@ -95,11 +96,11 @@ rgblink_obj := \ src/link/main.o: src/link/script.hpp rgbfix_obj := \ - src/fix/main.o \ - src/extern/getopt.o \ - src/error.o + ${common_obj} \ + src/fix/main.o rgbgfx_obj := \ + ${common_obj} \ src/gfx/main.o \ src/gfx/pal_packing.o \ src/gfx/pal_sorting.o \ @@ -108,9 +109,7 @@ rgbgfx_obj := \ src/gfx/proto_palette.o \ src/gfx/reverse.o \ src/gfx/rgba.o \ - src/gfx/warning.o \ - src/extern/getopt.o \ - src/error.o + src/gfx/warning.o rgbasm: ${rgbasm_obj} $Q${CXX} ${REALLDFLAGS} -o $@ ${rgbasm_obj} ${REALCXXFLAGS} src/version.cpp -lm diff --git a/include/asm/fstack.hpp b/include/asm/fstack.hpp index 3a8c4620..0e7103a9 100644 --- a/include/asm/fstack.hpp +++ b/include/asm/fstack.hpp @@ -50,7 +50,7 @@ extern size_t maxRecursionDepth; struct MacroArgs; -void fstk_DumpCurrent(); +bool fstk_DumpCurrent(); std::shared_ptr fstk_GetFileStack(); std::shared_ptr fstk_GetUniqueIDStr(); MacroArgs *fstk_GetCurrentMacroArgs(); diff --git a/include/asm/lexer.hpp b/include/asm/lexer.hpp index f07af2c6..8dfdeba8 100644 --- a/include/asm/lexer.hpp +++ b/include/asm/lexer.hpp @@ -109,7 +109,7 @@ struct LexerState { } void setAsCurrentState(); - bool setFileAsNextState(std::string const &filePath, bool updateStateNow); + void setFileAsNextState(std::string const &filePath, bool updateStateNow); void setViewAsNextState(char const *name, ContentSpan const &span, uint32_t lineNo_); void clear(uint32_t lineNo_); diff --git a/include/asm/warning.hpp b/include/asm/warning.hpp index d676b955..5df8b8e5 100644 --- a/include/asm/warning.hpp +++ b/include/asm/warning.hpp @@ -67,7 +67,7 @@ void warning(WarningID id, char const *fmt, ...); // It is also used when the assembler goes into an invalid state (for example, // when it fails to allocate memory). [[gnu::format(printf, 1, 2), noreturn]] -void fatalerror(char const *fmt, ...); +void fatal(char const *fmt, ...); // Used for errors that make it impossible to assemble correctly, but don't // affect the following code. The code will fail to assemble but the user will diff --git a/include/diagnostics.hpp b/include/diagnostics.hpp index 824c1454..d96bac68 100644 --- a/include/diagnostics.hpp +++ b/include/diagnostics.hpp @@ -13,10 +13,12 @@ #include #include -#include "error.hpp" #include "helpers.hpp" #include "itertools.hpp" +[[gnu::format(printf, 1, 2)]] +void warnx(char const *fmt, ...); + enum WarningAbled { WARNING_DEFAULT, WARNING_ENABLED, WARNING_DISABLED }; struct WarningState { diff --git a/include/error.hpp b/include/error.hpp deleted file mode 100644 index d5b657eb..00000000 --- a/include/error.hpp +++ /dev/null @@ -1,12 +0,0 @@ -// SPDX-License-Identifier: MIT - -#ifndef RGBDS_ERROR_HPP -#define RGBDS_ERROR_HPP - -[[gnu::format(printf, 1, 2)]] -void warnx(char const *fmt, ...); - -[[gnu::format(printf, 1, 2), noreturn]] -void errx(char const *fmt, ...); - -#endif // RGBDS_ERROR_HPP diff --git a/include/link/warning.hpp b/include/link/warning.hpp index 9a532521..96760d6f 100644 --- a/include/link/warning.hpp +++ b/include/link/warning.hpp @@ -9,14 +9,22 @@ struct FileStackNode; [[gnu::format(printf, 3, 4)]] void warning(FileStackNode const *where, uint32_t lineNo, char const *fmt, ...); +[[gnu::format(printf, 1, 2)]] +void warning(char const *fmt, ...); + [[gnu::format(printf, 3, 4)]] void error(FileStackNode const *where, uint32_t lineNo, char const *fmt, ...); [[gnu::format(printf, 1, 2)]] +void error(char const *fmt, ...); +[[gnu::format(printf, 1, 2)]] void errorNoDump(char const *fmt, ...); [[gnu::format(printf, 2, 3)]] void argErr(char flag, char const *fmt, ...); + [[gnu::format(printf, 3, 4), noreturn]] void fatal(FileStackNode const *where, uint32_t lineNo, char const *fmt, ...); +[[gnu::format(printf, 1, 2), noreturn]] +void fatal(char const *fmt, ...); void requireZeroErrors(); diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9287fe9a..ec1602d2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -3,8 +3,8 @@ configure_file(version.cpp _version.cpp ESCAPE_QUOTES) set(common_src - "error.cpp" "extern/getopt.cpp" + "diagnostics.cpp" "_version.cpp" ) @@ -47,10 +47,7 @@ set(rgbasm_src "asm/section.cpp" "asm/symbol.cpp" "asm/warning.cpp" - "extern/getopt.cpp" "extern/utf8decoder.cpp" - "diagnostics.cpp" - "error.cpp" "linkdefs.cpp" "opmath.cpp" "util.cpp" @@ -67,9 +64,7 @@ set(rgblink_src "link/section.cpp" "link/symbol.cpp" "link/warning.cpp" - "extern/getopt.cpp" "extern/utf8decoder.cpp" - "error.cpp" "linkdefs.cpp" "opmath.cpp" "util.cpp" @@ -77,8 +72,6 @@ set(rgblink_src set(rgbfix_src "fix/main.cpp" - "extern/getopt.cpp" - "error.cpp" ) set(rgbgfx_src @@ -91,8 +84,6 @@ set(rgbgfx_src "gfx/reverse.cpp" "gfx/rgba.cpp" "gfx/warning.cpp" - "extern/getopt.cpp" - "error.cpp" ) foreach(PROG "asm" "fix" "gfx" "link") diff --git a/src/asm/fstack.cpp b/src/asm/fstack.cpp index 8a49d3fe..302a3081 100644 --- a/src/asm/fstack.cpp +++ b/src/asm/fstack.cpp @@ -10,7 +10,7 @@ #include #include -#include "error.hpp" +#include "diagnostics.hpp" #include "helpers.hpp" #include "linkdefs.hpp" #include "platform.hpp" // S_ISDIR (stat macro) @@ -72,12 +72,13 @@ std::string const &FileStackNode::dump(uint32_t curLineNo) const { } } -void fstk_DumpCurrent() { +bool fstk_DumpCurrent() { if (lexer_AtTopLevel()) { - fputs("at top level", stderr); - return; + return false; } + assume(!contextStack.empty()); contextStack.top().fileInfo->dump(lexer_GetLineNo()); + return true; } std::shared_ptr fstk_GetFileStack() { @@ -159,7 +160,7 @@ bool yywrap() { uint32_t ifDepth = lexer_GetIFDepth(); if (ifDepth != 0) { - fatalerror( + fatal( "Ended block with %" PRIu32 " unterminated IF construct%s", ifDepth, ifDepth == 1 ? "" : "s" @@ -188,7 +189,7 @@ bool yywrap() { // This error message will refer to the current iteration if (sym->type != SYM_VAR) { - fatalerror("Failed to update FOR symbol value"); + fatal("Failed to update FOR symbol value"); } } // Advance to the next iteration @@ -211,11 +212,11 @@ bool yywrap() { static void checkRecursionDepth() { if (contextStack.size() > maxRecursionDepth) { - fatalerror("Recursion limit (%zu) exceeded", maxRecursionDepth); + fatal("Recursion limit (%zu) exceeded", maxRecursionDepth); } } -static bool newFileContext(std::string const &filePath, bool updateStateNow) { +static void newFileContext(std::string const &filePath, bool updateStateNow) { checkRecursionDepth(); std::shared_ptr uniqueIDStr = nullptr; @@ -237,7 +238,7 @@ static bool newFileContext(std::string const &filePath, bool updateStateNow) { .macroArgs = macroArgs, }); - return context.lexerState.setFileAsNextState(filePath, updateStateNow); + context.lexerState.setFileAsNextState(filePath, updateStateNow); } static void newMacroContext(Symbol const ¯o, std::shared_ptr macroArgs) { @@ -322,9 +323,7 @@ void fstk_RunInclude(std::string const &path, bool preInclude) { return; } - if (!newFileContext(*fullPath, false)) { - fatalerror("Failed to set up lexer for file include"); // LCOV_EXCL_LINE - } + newFileContext(*fullPath, false); } void fstk_RunMacro(std::string const ¯oName, std::shared_ptr macroArgs) { @@ -402,15 +401,13 @@ bool fstk_Break() { void fstk_NewRecursionDepth(size_t newDepth) { if (contextStack.size() > newDepth + 1) { - fatalerror("Recursion limit (%zu) exceeded", newDepth); + fatal("Recursion limit (%zu) exceeded", newDepth); } maxRecursionDepth = newDepth; } void fstk_Init(std::string const &mainPath, size_t maxDepth) { - if (!newFileContext(mainPath, true)) { - fatalerror("Failed to open main file"); - } + newFileContext(mainPath, true); maxRecursionDepth = maxDepth; diff --git a/src/asm/lexer.cpp b/src/asm/lexer.cpp index 0d355959..d66cb544 100644 --- a/src/asm/lexer.cpp +++ b/src/asm/lexer.cpp @@ -384,7 +384,7 @@ void lexer_IncIFDepth() { void lexer_DecIFDepth() { if (lexerState->ifStack.empty()) { - fatalerror("Found ENDC outside of an IF construct"); + fatal("Found ENDC outside of an IF construct"); } lexerState->ifStack.pop_front(); @@ -410,7 +410,7 @@ void LexerState::setAsCurrentState() { lexerState = this; } -bool LexerState::setFileAsNextState(std::string const &filePath, bool updateStateNow) { +void LexerState::setFileAsNextState(std::string const &filePath, bool updateStateNow) { if (filePath == "-") { path = ""; content.emplace(STDIN_FILENO); @@ -423,8 +423,7 @@ bool LexerState::setFileAsNextState(std::string const &filePath, bool updateStat struct stat statBuf; if (stat(filePath.c_str(), &statBuf) != 0) { // LCOV_EXCL_START - error("Failed to stat file \"%s\": %s", filePath.c_str(), strerror(errno)); - return false; + fatal("Failed to stat file \"%s\": %s", filePath.c_str(), strerror(errno)); // LCOV_EXCL_STOP } path = filePath; @@ -432,8 +431,7 @@ bool LexerState::setFileAsNextState(std::string const &filePath, bool updateStat int fd = open(path.c_str(), O_RDONLY); if (fd < 0) { // LCOV_EXCL_START - error("Failed to open file \"%s\": %s", path.c_str(), strerror(errno)); - return false; + fatal("Failed to open file \"%s\": %s", path.c_str(), strerror(errno)); // LCOV_EXCL_STOP } @@ -478,7 +476,6 @@ bool LexerState::setFileAsNextState(std::string const &filePath, bool updateStat } else { lexerStateEOL = this; } - return true; } void LexerState::setViewAsNextState(char const *name, ContentSpan const &span, uint32_t lineNo_) { @@ -565,7 +562,7 @@ size_t BufferedContent::readMore(size_t startIndex, size_t nbChars) { if (nbReadChars == -1) { // LCOV_EXCL_START - fatalerror("Error while reading \"%s\": %s", lexerState->path.c_str(), strerror(errno)); + fatal("Error while reading \"%s\": %s", lexerState->path.c_str(), strerror(errno)); // LCOV_EXCL_STOP } @@ -600,7 +597,7 @@ static void beginExpansion(std::shared_ptr str, std::optionalexpansions.size() > maxRecursionDepth + 1) { - fatalerror("Recursion limit (%zu) exceeded", maxRecursionDepth); + fatal("Recursion limit (%zu) exceeded", maxRecursionDepth); } } @@ -1337,7 +1334,7 @@ static Token readIdentifier(char firstChar, bool raw) { static std::shared_ptr readInterpolation(size_t depth) { if (depth > maxRecursionDepth) { - fatalerror("Recursion limit (%zu) exceeded", maxRecursionDepth); + fatal("Recursion limit (%zu) exceeded", maxRecursionDepth); } std::string fmtBuf; @@ -2292,7 +2289,7 @@ static Token skipIfBlock(bool toEndc) { case T_(POP_ELIF): if (lexer_ReachedELSEBlock()) { // This should be redundant, as the parser handles this error first. - fatalerror("Found ELIF after an ELSE block"); // LCOV_EXCL_LINE + fatal("Found ELIF after an ELSE block"); // LCOV_EXCL_LINE } if (!toEndc && lexer_GetIFDepth() == startingDepth) { return token; @@ -2301,7 +2298,7 @@ static Token skipIfBlock(bool toEndc) { case T_(POP_ELSE): if (lexer_ReachedELSEBlock()) { - fatalerror("Found ELSE after an ELSE block"); + fatal("Found ELSE after an ELSE block"); } lexer_ReachELSEBlock(); if (!toEndc && lexer_GetIFDepth() == startingDepth) { diff --git a/src/asm/main.cpp b/src/asm/main.cpp index 6c8e3450..6f28f8a9 100644 --- a/src/asm/main.cpp +++ b/src/asm/main.cpp @@ -11,7 +11,7 @@ #include #include -#include "error.hpp" +#include "diagnostics.hpp" #include "extern/getopt.hpp" #include "helpers.hpp" #include "parser.hpp" @@ -164,7 +164,7 @@ int main(int argc, char *argv[]) { if (strlen(musl_optarg) == 2) { opt_B(musl_optarg); } else { - errx("Must specify exactly 2 characters for option 'b'"); + fatal("Must specify exactly 2 characters for option 'b'"); } break; @@ -187,7 +187,7 @@ int main(int argc, char *argv[]) { if (strlen(musl_optarg) == 4) { opt_G(musl_optarg); } else { - errx("Must specify exactly 4 characters for option 'g'"); + fatal("Must specify exactly 4 characters for option 'g'"); } break; @@ -214,7 +214,7 @@ int main(int argc, char *argv[]) { } if (dependFile == nullptr) { // LCOV_EXCL_START - errx("Failed to open dependfile \"%s\": %s", dependFileName, strerror(errno)); + fatal("Failed to open dependfile \"%s\": %s", dependFileName, strerror(errno)); // LCOV_EXCL_STOP } break; @@ -232,11 +232,11 @@ int main(int argc, char *argv[]) { padByte = strtoul(musl_optarg, &endptr, 0); if (musl_optarg[0] == '\0' || *endptr != '\0') { - errx("Invalid argument for option 'p'"); + fatal("Invalid argument for option 'p'"); } if (padByte > 0xFF) { - errx("Argument for option 'p' must be between 0 and 0xFF"); + fatal("Argument for option 'p' must be between 0 and 0xFF"); } opt_P(padByte); @@ -252,11 +252,11 @@ int main(int argc, char *argv[]) { precision = strtoul(precisionArg, &endptr, 0); if (musl_optarg[0] == '\0' || *endptr != '\0') { - errx("Invalid argument for option 'Q'"); + fatal("Invalid argument for option 'Q'"); } if (precision < 1 || precision > 31) { - errx("Argument for option 'Q' must be between 1 and 31"); + fatal("Argument for option 'Q' must be between 1 and 31"); } opt_Q(precision); @@ -266,7 +266,7 @@ int main(int argc, char *argv[]) { maxDepth = strtoul(musl_optarg, &endptr, 0); if (musl_optarg[0] == '\0' || *endptr != '\0') { - errx("Invalid argument for option 'r'"); + fatal("Invalid argument for option 'r'"); } break; @@ -274,7 +274,7 @@ int main(int argc, char *argv[]) { // Split ":" so `musl_optarg` is "" and `name` is "" char *name = strchr(musl_optarg, ':'); if (!name) { - errx("Invalid argument for option 's'"); + fatal("Invalid argument for option 's'"); } *name++ = '\0'; @@ -293,7 +293,7 @@ int main(int argc, char *argv[]) { } // A feature must be specified if (*feature == '\0') { - errx("Empty feature for option 's'"); + fatal("Empty feature for option 's'"); } // Parse the `feature` and update the `features` list if (!strcasecmp(feature, "all")) { @@ -309,7 +309,7 @@ int main(int argc, char *argv[]) { : !strcasecmp(feature, "macro") ? STATE_MACRO : NB_STATE_FEATURES; if (value == NB_STATE_FEATURES) { - errx("Invalid feature for option 's': \"%s\"", feature); + fatal("Invalid feature for option 's': \"%s\"", feature); } else if (std::find(RANGE(features), value) != features.end()) { warnx("Ignoring duplicate feature for option 's': \"%s\"", feature); } else { @@ -354,11 +354,11 @@ int main(int argc, char *argv[]) { maxValue = strtoul(musl_optarg, &endptr, 0); if (musl_optarg[0] == '\0' || *endptr != '\0') { - errx("Invalid argument for option 'X'"); + fatal("Invalid argument for option 'X'"); } if (maxValue > UINT_MAX) { - errx("Argument for option 'X' must be between 0 and %u", UINT_MAX); + fatal("Argument for option 'X' must be between 0 and %u", UINT_MAX); } maxErrors = maxValue; @@ -416,8 +416,8 @@ int main(int argc, char *argv[]) { if (dependFile) { if (targetFileName.empty()) { - errx("Dependency files can only be created if a target file is specified with either " - "-o, -MQ or -MT"); + fatal("Dependency files can only be created if a target file is specified with either " + "-o, -MQ or -MT"); } fprintf(dependFile, "%s: %s\n", targetFileName.c_str(), mainFileName.c_str()); @@ -444,7 +444,8 @@ int main(int argc, char *argv[]) { } if (nbErrors != 0) { - errx("Assembly aborted (%u error%s)!", nbErrors, nbErrors == 1 ? "" : "s"); + fprintf(stderr, "Assembly aborted with %u error%s!\n", nbErrors, nbErrors == 1 ? "" : "s"); + exit(1); } // If parse aborted due to missing an include, and `-MG` was given, exit normally diff --git a/src/asm/output.cpp b/src/asm/output.cpp index f4f6f8d5..e5a6b197 100644 --- a/src/asm/output.cpp +++ b/src/asm/output.cpp @@ -11,7 +11,7 @@ #include #include -#include "error.hpp" +#include "diagnostics.hpp" #include "helpers.hpp" // assume, Defer #include "platform.hpp" @@ -73,7 +73,7 @@ static uint32_t getSectIDIfAny(Section *sect) { } // Every section that exists should be in `sectionMap` - fatalerror("Unknown section '%s'", sect->name.c_str()); // LCOV_EXCL_LINE + fatal("Unknown section '%s'", sect->name.c_str()); // LCOV_EXCL_LINE } static void writePatch(Patch const &patch, FILE *file) { @@ -326,7 +326,7 @@ void out_WriteObject() { } if (!file) { // LCOV_EXCL_START - errx("Failed to open object file '%s': %s", objectFileName.c_str(), strerror(errno)); + fatal("Failed to open object file '%s': %s", objectFileName.c_str(), strerror(errno)); // LCOV_EXCL_STOP } Defer closeFile{[&] { fclose(file); }}; @@ -528,7 +528,7 @@ void out_WriteState(std::string name, std::vector const &features) } if (!file) { // LCOV_EXCL_START - errx("Failed to open state file '%s': %s", name.c_str(), strerror(errno)); + fatal("Failed to open state file '%s': %s", name.c_str(), strerror(errno)); // LCOV_EXCL_STOP } Defer closeFile{[&] { fclose(file); }}; diff --git a/src/asm/parser.y b/src/asm/parser.y index 0f9ecb25..71da6665 100644 --- a/src/asm/parser.y +++ b/src/asm/parser.y @@ -488,11 +488,11 @@ if: elif: POP_ELIF iconst NEWLINE { if (lexer_GetIFDepth() == 0) { - fatalerror("Found ELIF outside of an IF construct"); + fatal("Found ELIF outside of an IF construct"); } if (lexer_RanIFBlock()) { if (lexer_ReachedELSEBlock()) { - fatalerror("Found ELIF after an ELSE block"); + fatal("Found ELIF after an ELSE block"); } lexer_SetMode(LEXER_SKIP_TO_ENDC); } else if ($2) { @@ -506,11 +506,11 @@ elif: else: POP_ELSE NEWLINE { if (lexer_GetIFDepth() == 0) { - fatalerror("Found ELSE outside of an IF construct"); + fatal("Found ELSE outside of an IF construct"); } if (lexer_RanIFBlock()) { if (lexer_ReachedELSEBlock()) { - fatalerror("Found ELSE after an ELSE block"); + fatal("Found ELSE after an ELSE block"); } lexer_SetMode(LEXER_SKIP_TO_ENDC); } else { @@ -779,7 +779,7 @@ endsection: fail: POP_FAIL string { - fatalerror("%s", $2.c_str()); + fatal("%s", $2.c_str()); } ; @@ -1608,7 +1608,7 @@ uconst: iconst { $$ = $1; if ($$ < 0) { - fatalerror("Constant must not be negative: %d", $$); + fatal("Constant must not be negative: %d", $$); } } ; @@ -1705,15 +1705,15 @@ string_literal: if (!sym) { if (sym_IsPurgedScoped($3)) { - fatalerror("Unknown symbol \"%s\"; it was purged", $3.c_str()); + fatal("Unknown symbol \"%s\"; it was purged", $3.c_str()); } else { - fatalerror("Unknown symbol \"%s\"", $3.c_str()); + fatal("Unknown symbol \"%s\"", $3.c_str()); } } Section const *section = sym->getSection(); if (!section) { - fatalerror("\"%s\" does not belong to any section", sym->name.c_str()); + fatal("\"%s\" does not belong to any section", sym->name.c_str()); } // Section names are capped by rgbasm's maximum string length, // so this currently can't overflow. @@ -3041,7 +3041,7 @@ static void compoundAssignment(std::string const &symName, RPNCommand op, int32_ static void failAssert(AssertionType type) { switch (type) { case ASSERT_FATAL: - fatalerror("Assertion failed"); + fatal("Assertion failed"); case ASSERT_ERROR: error("Assertion failed"); break; @@ -3054,7 +3054,7 @@ static void failAssert(AssertionType type) { static void failAssertMsg(AssertionType type, std::string const &message) { switch (type) { case ASSERT_FATAL: - fatalerror("Assertion failed: %s", message.c_str()); + fatal("Assertion failed: %s", message.c_str()); case ASSERT_ERROR: error("Assertion failed: %s", message.c_str()); break; diff --git a/src/asm/rpn.cpp b/src/asm/rpn.cpp index 52661e55..7f3028a2 100644 --- a/src/asm/rpn.cpp +++ b/src/asm/rpn.cpp @@ -434,7 +434,7 @@ void Expression::makeBinaryOp(RPNCommand op, Expression &&src1, Expression const break; case RPN_DIV: if (rval == 0) { - fatalerror("Division by zero"); + fatal("Division by zero"); } if (lval == INT32_MIN && rval == -1) { @@ -451,7 +451,7 @@ void Expression::makeBinaryOp(RPNCommand op, Expression &&src1, Expression const break; case RPN_MOD: if (rval == 0) { - fatalerror("Modulo by zero"); + fatal("Modulo by zero"); } if (lval == INT32_MIN && rval == -1) { @@ -462,7 +462,7 @@ void Expression::makeBinaryOp(RPNCommand op, Expression &&src1, Expression const break; case RPN_EXP: if (rval < 0) { - fatalerror("Exponentiation by negative power"); + fatal("Exponentiation by negative power"); } data = op_exponent(lval, rval); diff --git a/src/asm/section.cpp b/src/asm/section.cpp index dfb18f23..ce301113 100644 --- a/src/asm/section.cpp +++ b/src/asm/section.cpp @@ -265,7 +265,7 @@ static void mergeSections( } if (nbSectErrors) { - fatalerror( + fatal( "Cannot create section \"%s\" (%u error%s)", sect.name.c_str(), nbSectErrors, @@ -411,7 +411,7 @@ static Section *getSection( // Set the current section static void changeSection() { if (!currentUnionStack.empty()) { - fatalerror("Cannot change the section within a UNION"); + fatal("Cannot change the section within a UNION"); } sym_ResetCurrentLabelScopes(); @@ -448,7 +448,7 @@ void sect_NewSection( ) { for (SectionStackEntry &entry : sectionStack) { if (entry.section && entry.section->name == name) { - fatalerror("Section '%s' is already on the stack", name.c_str()); + fatal("Section '%s' is already on the stack", name.c_str()); } } @@ -609,7 +609,7 @@ void sect_AlignPC(uint8_t alignment, uint16_t offset) { static void growSection(uint32_t growth) { if (growth > 0 && curOffset > UINT32_MAX - growth) { - fatalerror("Section size would overflow internal counter"); + fatal("Section size would overflow internal counter"); } curOffset += growth; if (uint32_t outOffset = sect_GetOutputOffset(); outOffset > currentSection->size) { @@ -1025,7 +1025,7 @@ void sect_PushSection() { void sect_PopSection() { if (sectionStack.empty()) { - fatalerror("No entries in the section stack"); + fatal("No entries in the section stack"); } if (currentLoadSection) { @@ -1052,11 +1052,11 @@ void sect_CheckStack() { void sect_EndSection() { if (!currentSection) { - fatalerror("Cannot end the section outside of a SECTION"); + fatal("Cannot end the section outside of a SECTION"); } if (!currentUnionStack.empty()) { - fatalerror("Cannot end the section within a UNION"); + fatal("Cannot end the section within a UNION"); } if (currentLoadSection) { diff --git a/src/asm/symbol.cpp b/src/asm/symbol.cpp index 49293863..d0d10d6a 100644 --- a/src/asm/symbol.cpp +++ b/src/asm/symbol.cpp @@ -9,7 +9,7 @@ #include #include -#include "error.hpp" +#include "diagnostics.hpp" #include "helpers.hpp" // assume #include "util.hpp" #include "version.hpp" @@ -217,12 +217,12 @@ static bool isAutoScoped(std::string const &symName) { // Check for nothing after the dot if (dotPos == symName.length() - 1) { - fatalerror("'%s' is a nonsensical reference to an empty local label", symName.c_str()); + fatal("'%s' is a nonsensical reference to an empty local label", symName.c_str()); } // Check for more than one dot if (symName.find('.', dotPos + 1) != std::string::npos) { - fatalerror("'%s' is a nonsensical reference to a nested local label", symName.c_str()); + fatal("'%s' is a nonsensical reference to a nested local label", symName.c_str()); } // Check for already-qualified local label @@ -232,7 +232,7 @@ static bool isAutoScoped(std::string const &symName) { // Check for unqualifiable local label if (!globalScope) { - fatalerror("Unqualified local label '%s' in main scope", symName.c_str()); + fatal("Unqualified local label '%s' in main scope", symName.c_str()); } return true; diff --git a/src/asm/warning.cpp b/src/asm/warning.cpp index 44b4ef1a..daa66ab0 100644 --- a/src/asm/warning.cpp +++ b/src/asm/warning.cpp @@ -9,7 +9,7 @@ #include #include -#include "error.hpp" +#include "diagnostics.hpp" #include "helpers.hpp" #include "itertools.hpp" @@ -70,9 +70,10 @@ static void printDiag( ) { fputs(type, stderr); fputs(": ", stderr); - fstk_DumpCurrent(); - fprintf(stderr, flagfmt, flag); - fputs("\n ", stderr); + if (fstk_DumpCurrent()) { + fprintf(stderr, flagfmt, flag); + fputs("\n ", stderr); + } vfprintf(stderr, fmt, args); putc('\n', stderr); lexer_DumpStringExpansions(); @@ -82,12 +83,14 @@ static void incrementErrors() { // This intentionally makes 0 act as "unlimited" (or at least "limited to sizeof(unsigned)") nbErrors++; if (nbErrors == maxErrors) { - errx( - "The maximum of %u error%s was reached (configure with \"-X/--max-errors\"); assembly " - "aborted!", - maxErrors, - maxErrors == 1 ? "" : "s" + fprintf( + stderr, + "Assembly aborted after the maximum of %u error%s! (configure with " + "'-X/--max-errors')\n", + nbErrors, + nbErrors == 1 ? "" : "s" ); + exit(1); } } @@ -103,8 +106,9 @@ void error(char const *fmt, ...) { void error(std::function callback) { fputs("error: ", stderr); - fstk_DumpCurrent(); - fputs(":\n ", stderr); + if (fstk_DumpCurrent()) { + fputs(":\n ", stderr); + } callback(); putc('\n', stderr); lexer_DumpStringExpansions(); @@ -113,7 +117,7 @@ void error(std::function callback) { } [[noreturn]] -void fatalerror(char const *fmt, ...) { +void fatal(char const *fmt, ...) { va_list args; va_start(args, fmt); diff --git a/src/diagnostics.cpp b/src/diagnostics.cpp index 21d6b657..f86f4897 100644 --- a/src/diagnostics.cpp +++ b/src/diagnostics.cpp @@ -1,5 +1,14 @@ #include "diagnostics.hpp" +void warnx(char const *fmt, ...) { + va_list ap; + fputs("warning: ", stderr); + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + va_end(ap); + putc('\n', stderr); +} + void WarningState::update(WarningState other) { if (other.state != WARNING_DEFAULT) { state = other.state; diff --git a/src/error.cpp b/src/error.cpp deleted file mode 100644 index 4f169c1c..00000000 --- a/src/error.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-License-Identifier: MIT - -#include "error.hpp" - -#include -#include -#include -#include -#include - -void warnx(char const *fmt, ...) { - va_list ap; - fputs("warning: ", stderr); - va_start(ap, fmt); - vfprintf(stderr, fmt, ap); - va_end(ap); - putc('\n', stderr); -} - -[[noreturn]] -void errx(char const *fmt, ...) { - va_list ap; - fputs("error: ", stderr); - va_start(ap, fmt); - vfprintf(stderr, fmt, ap); - va_end(ap); - putc('\n', stderr); - exit(1); -} diff --git a/src/fix/main.cpp b/src/fix/main.cpp index e4ebb809..dae2a4e2 100644 --- a/src/fix/main.cpp +++ b/src/fix/main.cpp @@ -12,7 +12,7 @@ #include #include -#include "error.hpp" +#include "diagnostics.hpp" #include "extern/getopt.hpp" #include "helpers.hpp" #include "platform.hpp" diff --git a/src/gfx/main.cpp b/src/gfx/main.cpp index ac618dd1..1adf8735 100644 --- a/src/gfx/main.cpp +++ b/src/gfx/main.cpp @@ -14,7 +14,7 @@ #include #include -#include "error.hpp" +#include "diagnostics.hpp" #include "extern/getopt.hpp" #include "file.hpp" #include "platform.hpp" diff --git a/src/gfx/pal_spec.cpp b/src/gfx/pal_spec.cpp index 00623c71..907395d7 100644 --- a/src/gfx/pal_spec.cpp +++ b/src/gfx/pal_spec.cpp @@ -17,7 +17,7 @@ #include #include -#include "error.hpp" +#include "diagnostics.hpp" #include "helpers.hpp" #include "platform.hpp" diff --git a/src/gfx/process.cpp b/src/gfx/process.cpp index dfeeba18..427c30ff 100644 --- a/src/gfx/process.cpp +++ b/src/gfx/process.cpp @@ -15,7 +15,7 @@ #include #include -#include "error.hpp" +#include "diagnostics.hpp" #include "file.hpp" #include "helpers.hpp" #include "itertools.hpp" diff --git a/src/gfx/reverse.cpp b/src/gfx/reverse.cpp index e0d41e1d..e78849f4 100644 --- a/src/gfx/reverse.cpp +++ b/src/gfx/reverse.cpp @@ -12,7 +12,7 @@ #include #include -#include "error.hpp" +#include "diagnostics.hpp" #include "file.hpp" #include "helpers.hpp" // assume diff --git a/src/link/assign.cpp b/src/link/assign.cpp index 428ad2be..ba852656 100644 --- a/src/link/assign.cpp +++ b/src/link/assign.cpp @@ -9,7 +9,7 @@ #include #include -#include "error.hpp" +#include "diagnostics.hpp" #include "helpers.hpp" #include "itertools.hpp" #include "linkdefs.hpp" @@ -299,7 +299,7 @@ static void placeSection(Section §ion) { // If a section failed to go to several places, nothing we can report if (!section.isBankFixed || !section.isAddressFixed) { - errx( + fatal( "Unable to place \"%s\" (%s section) %s", section.name.c_str(), sectionTypeInfo[section.type].name.c_str(), @@ -308,7 +308,7 @@ static void placeSection(Section §ion) { } // If the section just can't fit the bank, report that else if (section.org + section.size > endaddr(section.type) + 1) { - errx( + fatal( "Unable to place \"%s\" (%s section) %s: section runs past end of region ($%04x > " "$%04x)", section.name.c_str(), @@ -320,7 +320,7 @@ static void placeSection(Section §ion) { } // Otherwise there is overlap with another section else { - errx( + fatal( "Unable to place \"%s\" (%s section) %s: section overlaps with \"%s\"", section.name.c_str(), sectionTypeInfo[section.type].name.c_str(), diff --git a/src/link/main.cpp b/src/link/main.cpp index 2873114d..49230071 100644 --- a/src/link/main.cpp +++ b/src/link/main.cpp @@ -9,7 +9,7 @@ #include #include -#include "error.hpp" +#include "diagnostics.hpp" #include "extern/getopt.hpp" #include "helpers.hpp" // assume #include "itertools.hpp" diff --git a/src/link/object.cpp b/src/link/object.cpp index a0097339..bc038c26 100644 --- a/src/link/object.cpp +++ b/src/link/object.cpp @@ -13,7 +13,7 @@ #include #include -#include "error.hpp" +#include "diagnostics.hpp" #include "helpers.hpp" #include "linkdefs.hpp" #include "platform.hpp" @@ -37,7 +37,7 @@ static std::vector> nodes; FILE *tmpFile = file; \ type tmpVal = func(tmpFile); \ if (tmpVal == (errval)) { \ - errx(__VA_ARGS__, feof(tmpFile) ? "Unexpected end of file" : strerror(errno)); \ + fatal(__VA_ARGS__, feof(tmpFile) ? "Unexpected end of file" : strerror(errno)); \ } \ var = static_cast(tmpVal); \ } while (0) @@ -78,7 +78,7 @@ static int64_t readLong(FILE *file) { std::string &tmpVal = var; \ for (int tmpByte = getc(tmpFile); tmpByte != '\0'; tmpByte = getc(tmpFile)) { \ if (tmpByte == EOF) { \ - errx(__VA_ARGS__, feof(tmpFile) ? "Unexpected end of file" : strerror(errno)); \ + fatal(__VA_ARGS__, feof(tmpFile) ? "Unexpected end of file" : strerror(errno)); \ } else { \ tmpVal.push_back(tmpByte); \ } \ @@ -136,8 +136,6 @@ static void readFileStackNode( } if (!node.parent) { fatal( - nullptr, - 0, "%s is not a valid object file: root node (#%" PRIu32 ") may not be REPT", fileName, nodeID @@ -275,7 +273,7 @@ static void readPatch( size_t nbElementsRead = fread(patch.rpnExpression.data(), 1, rpnSize, file); if (nbElementsRead != rpnSize) { - errx( + fatal( "%s: Cannot read \"%s\"'s patch #%" PRIu32 "'s RPN expression: %s", fileName, sectName.c_str(), @@ -314,7 +312,7 @@ static void readSection( ); tryReadLong(tmp, file, "%s: Cannot read \"%s\"'s' size: %s", fileName, section.name.c_str()); if (tmp < 0 || tmp > UINT16_MAX) { - errx("\"%s\"'s section size ($%" PRIx32 ") is invalid", section.name.c_str(), tmp); + fatal("\"%s\"'s section size ($%" PRIx32 ") is invalid", section.name.c_str(), tmp); } section.size = tmp; section.offset = 0; @@ -322,7 +320,7 @@ static void readSection( uint8_t, byte, file, "%s: Cannot read \"%s\"'s type: %s", fileName, section.name.c_str() ); if (uint8_t type = byte & 0x3F; type >= SECTTYPE_INVALID) { - errx("\"%s\" has unknown section type 0x%02x", section.name.c_str(), type); + fatal("\"%s\" has unknown section type 0x%02x", section.name.c_str(), type); } else { section.type = SectionType(type); } @@ -336,7 +334,7 @@ static void readSection( tryReadLong(tmp, file, "%s: Cannot read \"%s\"'s org: %s", fileName, section.name.c_str()); section.isAddressFixed = tmp >= 0; if (tmp > UINT16_MAX) { - error(nullptr, 0, "\"%s\"'s org is too large ($%" PRIx32 ")", section.name.c_str(), tmp); + error("\"%s\"'s org is too large ($%" PRIx32 ")", section.name.c_str(), tmp); tmp = UINT16_MAX; } section.org = tmp; @@ -360,13 +358,7 @@ static void readSection( tmp, file, "%s: Cannot read \"%s\"'s alignment offset: %s", fileName, section.name.c_str() ); if (tmp > UINT16_MAX) { - error( - nullptr, - 0, - "\"%s\"'s alignment offset is too large ($%" PRIx32 ")", - section.name.c_str(), - tmp - ); + error("\"%s\"'s alignment offset is too large ($%" PRIx32 ")", section.name.c_str(), tmp); tmp = UINT16_MAX; } section.alignOfs = tmp; @@ -376,7 +368,7 @@ static void readSection( section.data.resize(section.size); if (size_t nbRead = fread(section.data.data(), 1, section.size, file); nbRead != section.size) { - errx( + fatal( "%s: Cannot read \"%s\"'s data: %s", fileName, section.name.c_str(), @@ -446,7 +438,7 @@ void obj_ReadFile(char const *fileName, unsigned int fileID) { file = stdin; } if (!file) { - errx("Failed to open file \"%s\": %s", fileName, strerror(errno)); + fatal("Failed to open file \"%s\": %s", fileName, strerror(errno)); } Defer closeFile{[&] { fclose(file); }}; @@ -457,7 +449,7 @@ void obj_ReadFile(char const *fileName, unsigned int fileID) { ungetc(c, file); // Guaranteed to work switch (c) { case EOF: - fatal(nullptr, 0, "File \"%s\" is empty!", fileName); + fatal("File \"%s\" is empty!", fileName); case 'R': break; @@ -484,7 +476,7 @@ void obj_ReadFile(char const *fileName, unsigned int fileID) { if (fscanf(file, RGBDS_OBJECT_VERSION_STRING "%n", &matchedElems) == 1 && matchedElems != literal_strlen(RGBDS_OBJECT_VERSION_STRING)) { - errx("%s: Not a RGBDS object file", fileName); + fatal("%s: Not a RGBDS object file", fileName); } verbosePrint("Reading object file %s\n", fileName); @@ -493,7 +485,7 @@ void obj_ReadFile(char const *fileName, unsigned int fileID) { tryReadLong(revNum, file, "%s: Cannot read revision number: %s", fileName); if (revNum != RGBDS_OBJECT_REV) { - errx( + fatal( "%s: Unsupported object file for rgblink %s; try rebuilding \"%s\"%s" " (expected revision %d, got %d)", fileName, diff --git a/src/link/output.cpp b/src/link/output.cpp index b4a0d1e8..5d97de6b 100644 --- a/src/link/output.cpp +++ b/src/link/output.cpp @@ -11,7 +11,7 @@ #include #include -#include "error.hpp" +#include "diagnostics.hpp" #include "extern/utf8decoder.hpp" #include "helpers.hpp" #include "linkdefs.hpp" @@ -71,7 +71,7 @@ void out_AddSection(Section const §ion) { uint32_t minNbBanks = targetBank + 1; if (minNbBanks > maxNbBanks[section.type]) { - errx( + fatal( "Section \"%s\" has an invalid bank range (%" PRIu32 " > %" PRIu32 ")", section.name.c_str(), section.bank, @@ -213,7 +213,7 @@ static void writeROM() { outputFile = stdout; } if (!outputFile) { - errx("Failed to open output file \"%s\": %s", outputFileName, strerror(errno)); + fatal("Failed to open output file \"%s\": %s", outputFileName, strerror(errno)); } } Defer closeOutputFile{[&] { @@ -231,7 +231,7 @@ static void writeROM() { overlayFile = stdin; } if (!overlayFile) { - errx("Failed to open overlay file \"%s\": %s", overlayFileName, strerror(errno)); + fatal("Failed to open overlay file \"%s\": %s", overlayFileName, strerror(errno)); } } Defer closeOverlayFile{[&] { @@ -574,7 +574,7 @@ static void writeSym() { symFile = stdout; } if (!symFile) { - errx("Failed to open sym file \"%s\": %s", symFileName, strerror(errno)); + fatal("Failed to open sym file \"%s\": %s", symFileName, strerror(errno)); } Defer closeSymFile{[&] { fclose(symFile); }}; @@ -625,7 +625,7 @@ static void writeMap() { mapFile = stdout; } if (!mapFile) { - errx("Failed to open map file \"%s\": %s", mapFileName, strerror(errno)); + fatal("Failed to open map file \"%s\": %s", mapFileName, strerror(errno)); } Defer closeMapFile{[&] { fclose(mapFile); }}; diff --git a/src/link/script.y b/src/link/script.y index c00e68bf..3f97af3b 100644 --- a/src/link/script.y +++ b/src/link/script.y @@ -150,8 +150,6 @@ optional: #define scriptError(context, fmt, ...) \ ::error( \ - nullptr, \ - 0, \ "%s(%" PRIu32 "): " fmt, \ context.path.c_str(), \ context.lineNo __VA_OPT__(, ) __VA_ARGS__ \ @@ -746,7 +744,7 @@ void script_ProcessScript(char const *path) { auto &newContext = lexerStack.emplace_back(std::string(path)); if (!newContext.file.open(newContext.path, std::ios_base::in)) { - error(nullptr, 0, "Failed to open linker script \"%s\"", newContext.path.c_str()); + error("Failed to open linker script \"%s\"", newContext.path.c_str()); lexerStack.clear(); } else { yy::parser linkerScriptParser; diff --git a/src/link/section.cpp b/src/link/section.cpp index 76332b81..35f95a49 100644 --- a/src/link/section.cpp +++ b/src/link/section.cpp @@ -7,7 +7,7 @@ #include #include -#include "error.hpp" +#include "diagnostics.hpp" #include "helpers.hpp" #include "link/warning.hpp" @@ -219,7 +219,7 @@ void sect_AddSection(std::unique_ptr
&§ion) { if (Section *target = sect_GetSection(section->name); target) { mergeSections(*target, std::move(section)); } else if (section->modifier == SECTION_UNION && sect_HasData(section->type)) { - errx( + fatal( "Section \"%s\" is of type %s, which cannot be unionized", section->name.c_str(), sectionTypeInfo[section->type].name.c_str() @@ -242,10 +242,7 @@ static void doSanityChecks(Section §ion) { // This is trapped early in RGBDS objects (because then the format is not parseable), // which leaves SDAS objects. error( - nullptr, - 0, - "Section \"%s\" has not been assigned a type by a linker script", - section.name.c_str() + "Section \"%s\" has not been assigned a type by a linker script", section.name.c_str() ); return; } @@ -253,8 +250,6 @@ static void doSanityChecks(Section §ion) { if (is32kMode && section.type == SECTTYPE_ROMX) { if (section.isBankFixed && section.bank != 1) { error( - nullptr, - 0, "Section \"%s\" has type ROMX, which must be in bank 1 (if any) with option `-t`", section.name.c_str() ); @@ -265,8 +260,6 @@ static void doSanityChecks(Section §ion) { if (isWRAM0Mode && section.type == SECTTYPE_WRAMX) { if (section.isBankFixed && section.bank != 1) { error( - nullptr, - 0, "Section \"%s\" has type WRAMX, which must be in bank 1 with options `-w` or `-d`", section.name.c_str() ); @@ -276,8 +269,6 @@ static void doSanityChecks(Section §ion) { } if (isDmgMode && section.type == SECTTYPE_VRAM && section.bank == 1) { error( - nullptr, - 0, "Section \"%s\" has type VRAM, which must be in bank 0 with option `-d`", section.name.c_str() ); @@ -292,8 +283,6 @@ static void doSanityChecks(Section §ion) { // Too large an alignment may not be satisfiable if (section.isAlignFixed && (section.alignMask & sectionTypeInfo[section.type].startAddr)) { error( - nullptr, - 0, "Section \"%s\" has type %s, which cannot be aligned to $%04x bytes", section.name.c_str(), sectionTypeInfo[section.type].name.c_str(), @@ -306,8 +295,6 @@ static void doSanityChecks(Section §ion) { if (section.isBankFixed && section.bank < minbank && section.bank > maxbank) { error( - nullptr, - 0, minbank == maxbank ? "Cannot place section \"%s\" in bank %" PRIu32 ", it must be %" PRIu32 : "Cannot place section \"%s\" in bank %" PRIu32 ", it must be between %" PRIu32 @@ -322,8 +309,6 @@ static void doSanityChecks(Section §ion) { // Check if section has a chance to be placed if (section.size > sectionTypeInfo[section.type].size) { error( - nullptr, - 0, "Section \"%s\" is bigger than the max size for that type: $%" PRIx16 " > $%" PRIx16, section.name.c_str(), section.size, @@ -343,8 +328,6 @@ static void doSanityChecks(Section §ion) { if (section.isAlignFixed) { if ((section.org & section.alignMask) != section.alignOfs) { error( - nullptr, - 0, "Section \"%s\"'s fixed address doesn't match its alignment", section.name.c_str() ); @@ -356,8 +339,6 @@ static void doSanityChecks(Section §ion) { if (section.org < sectionTypeInfo[section.type].startAddr || section.org > endaddr(section.type)) { error( - nullptr, - 0, "Section \"%s\"'s fixed address $%04" PRIx16 " is outside of range [$%04" PRIx16 "; $%04" PRIx16 "]", section.name.c_str(), @@ -369,8 +350,6 @@ static void doSanityChecks(Section §ion) { if (section.org + section.size > endaddr(section.type) + 1) { error( - nullptr, - 0, "Section \"%s\"'s end address $%04x is greater than last address $%04x", section.name.c_str(), section.org + section.size, diff --git a/src/link/warning.cpp b/src/link/warning.cpp index 6674fa9b..32872b0f 100644 --- a/src/link/warning.cpp +++ b/src/link/warning.cpp @@ -10,10 +10,9 @@ static uint32_t nbErrors = 0; static void printDiag( - char const *fmt, va_list args, char const *type, FileStackNode const *where, uint32_t lineNo + FileStackNode const *where, uint32_t lineNo, char const *fmt, va_list args, char const *type ) { - fputs(type, stderr); - fputs(": ", stderr); + fprintf(stderr, "%s: ", type); if (where) { where->dump(lineNo); fputs(": ", stderr); @@ -22,22 +21,54 @@ static void printDiag( putc('\n', stderr); } +static void incrementErrors() { + if (nbErrors != UINT32_MAX) { + nbErrors++; + } +} + +[[noreturn]] +static void abortLinking(char const *verb) { + fprintf( + stderr, + "Linking %s with %" PRIu32 " error%s\n", + verb ? verb : "aborted", + nbErrors, + nbErrors == 1 ? "" : "s" + ); + exit(1); +} + void warning(FileStackNode const *where, uint32_t lineNo, char const *fmt, ...) { va_list args; va_start(args, fmt); - printDiag(fmt, args, "warning", where, lineNo); + printDiag(where, lineNo, fmt, args, "warning"); + va_end(args); +} + +void warning(char const *fmt, ...) { + va_list args; + va_start(args, fmt); + printDiag(nullptr, 0, fmt, args, "warning"); va_end(args); } void error(FileStackNode const *where, uint32_t lineNo, char const *fmt, ...) { va_list args; va_start(args, fmt); - printDiag(fmt, args, "error", where, lineNo); + printDiag(where, lineNo, fmt, args, "error"); va_end(args); - if (nbErrors != UINT32_MAX) { - nbErrors++; - } + incrementErrors(); +} + +void error(char const *fmt, ...) { + va_list args; + va_start(args, fmt); + printDiag(nullptr, 0, fmt, args, "error"); + va_end(args); + + incrementErrors(); } void errorNoDump(char const *fmt, ...) { @@ -47,9 +78,7 @@ void errorNoDump(char const *fmt, ...) { vfprintf(stderr, fmt, args); va_end(args); - if (nbErrors != UINT32_MAX) { - nbErrors++; - } + incrementErrors(); } void argErr(char flag, char const *fmt, ...) { @@ -60,33 +89,33 @@ void argErr(char flag, char const *fmt, ...) { va_end(args); putc('\n', stderr); - if (nbErrors != UINT32_MAX) { - nbErrors++; - } + incrementErrors(); } [[noreturn]] void fatal(FileStackNode const *where, uint32_t lineNo, char const *fmt, ...) { va_list args; va_start(args, fmt); - printDiag(fmt, args, "FATAL", where, lineNo); + printDiag(where, lineNo, fmt, args, "FATAL"); va_end(args); - if (nbErrors != UINT32_MAX) { - nbErrors++; - } + incrementErrors(); + abortLinking(nullptr); +} - fprintf( - stderr, "Linking aborted after %" PRIu32 " error%s\n", nbErrors, nbErrors == 1 ? "" : "s" - ); - exit(1); +[[noreturn]] +void fatal(char const *fmt, ...) { + va_list args; + va_start(args, fmt); + printDiag(nullptr, 0, fmt, args, "FATAL"); + va_end(args); + + incrementErrors(); + abortLinking(nullptr); } void requireZeroErrors() { if (nbErrors != 0) { - fprintf( - stderr, "Linking failed with %" PRIu32 " error%s\n", nbErrors, nbErrors == 1 ? "" : "s" - ); - exit(1); + abortLinking("failed"); } } diff --git a/test/asm/align-large-ofs.err b/test/asm/align-large-ofs.err index 1cbdb2fd..9f45202c 100644 --- a/test/asm/align-large-ofs.err +++ b/test/asm/align-large-ofs.err @@ -1,3 +1,3 @@ error: align-large-ofs.asm(2): The absolute alignment offset (2) must be less than alignment size (2) -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/align-large.err b/test/asm/align-large.err index af607f25..ac766740 100644 --- a/test/asm/align-large.err +++ b/test/asm/align-large.err @@ -2,4 +2,4 @@ error: align-large.asm(1): Alignment must be between 0 and 16, not 17 error: align-large.asm(2): Alignment must be between 0 and 16, not 17 -error: Assembly aborted (2 errors)! +Assembly aborted with 2 errors! diff --git a/test/asm/align-offset.err b/test/asm/align-offset.err index e3e3369a..0b4bee9c 100644 --- a/test/asm/align-offset.err +++ b/test/asm/align-offset.err @@ -2,4 +2,4 @@ error: align-offset.asm(4): The absolute alignment offset (18) must be less than alignment size (16) error: align-offset.asm(6): The absolute alignment offset (20) must be less than alignment size (16) -error: Assembly aborted (2 errors)! +Assembly aborted with 2 errors! diff --git a/test/asm/align-pc-outside-section.err b/test/asm/align-pc-outside-section.err index 895edb9a..0ae44fa6 100644 --- a/test/asm/align-pc-outside-section.err +++ b/test/asm/align-pc-outside-section.err @@ -1,3 +1,3 @@ error: align-pc-outside-section.asm(1): Cannot output data outside of a SECTION -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/align-unattainable.err b/test/asm/align-unattainable.err index 005fc7f3..2f20af01 100644 --- a/test/asm/align-unattainable.err +++ b/test/asm/align-unattainable.err @@ -1,3 +1,3 @@ error: align-unattainable.asm(3): Section "X"'s alignment cannot be attained in WRAM0 -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/anon-label-bad.err b/test/asm/anon-label-bad.err index 31b225ba..d57654ed 100644 --- a/test/asm/anon-label-bad.err +++ b/test/asm/anon-label-bad.err @@ -8,4 +8,4 @@ error: anon-label-bad.asm(10): syntax error, unexpected anonymous label, expecting symbol or label or local label error: anon-label-bad.asm(22): syntax error, unexpected :: -error: Assembly aborted (5 errors)! +Assembly aborted with 5 errors! diff --git a/test/asm/assert-nosect-bank.err b/test/asm/assert-nosect-bank.err index 019bbd96..39c5023d 100644 --- a/test/asm/assert-nosect-bank.err +++ b/test/asm/assert-nosect-bank.err @@ -1,3 +1,3 @@ error: assert-nosect-bank.asm(1): PC has no bank outside of a section -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/assert@-no-sect.err b/test/asm/assert@-no-sect.err index 31bff018..d9fd70a8 100644 --- a/test/asm/assert@-no-sect.err +++ b/test/asm/assert@-no-sect.err @@ -1,3 +1,3 @@ error: assert@-no-sect.asm(1): PC has no value outside of a section -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/bank.err b/test/asm/bank.err index ef111113..c55ae654 100644 --- a/test/asm/bank.err +++ b/test/asm/bank.err @@ -20,4 +20,4 @@ error: bank.asm(22) -> bank.asm::def_sect(8): Expected constant expression: "Label_u12"'s bank is not known error: bank.asm(26): BANK argument must be a label -error: Assembly aborted (11 errors)! +Assembly aborted with 11 errors! diff --git a/test/asm/block-comment-termination-error.err b/test/asm/block-comment-termination-error.err index 9ba882ea..21707d44 100644 --- a/test/asm/block-comment-termination-error.err +++ b/test/asm/block-comment-termination-error.err @@ -2,4 +2,4 @@ error: block-comment-termination-error.asm(1): Unterminated block comment error: block-comment-termination-error.asm(1): syntax error, unexpected end of buffer -error: Assembly aborted (2 errors)! +Assembly aborted with 2 errors! diff --git a/test/asm/bracketed-macro-args.err b/test/asm/bracketed-macro-args.err index f080ed30..10f6be1d 100644 --- a/test/asm/bracketed-macro-args.err +++ b/test/asm/bracketed-macro-args.err @@ -10,4 +10,4 @@ error: bracketed-macro-args.asm(33) -> bracketed-macro-args.asm::bad(30): Macro argument '\<2>' not defined error: bracketed-macro-args.asm(39) -> bracketed-macro-args.asm::toolong(36): Bracketed symbol "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz" does not exist -error: Assembly aborted (6 errors)! +Assembly aborted with 6 errors! diff --git a/test/asm/bracketed-symbols.err b/test/asm/bracketed-symbols.err index 81a0008c..475ecac2 100644 --- a/test/asm/bracketed-symbols.err +++ b/test/asm/bracketed-symbols.err @@ -4,4 +4,4 @@ error: bracketed-symbols.asm(20): "Label" does not have a constant value error: bracketed-symbols.asm(21): PC does not have a constant value; the current section is not fixed -error: Assembly aborted (3 errors)! +Assembly aborted with 3 errors! diff --git a/test/asm/builtin-overwrite.err b/test/asm/builtin-overwrite.err index 95d90465..eedd2a0e 100644 --- a/test/asm/builtin-overwrite.err +++ b/test/asm/builtin-overwrite.err @@ -54,4 +54,4 @@ error: builtin-overwrite.asm(37) -> builtin-overwrite.asm::tickle(29): Built-in symbol '__ISO_8601_UTC__' cannot be redefined error: builtin-overwrite.asm(37) -> builtin-overwrite.asm::tickle(30): Built-in symbol '__ISO_8601_UTC__' cannot be redefined -error: Assembly aborted (28 errors)! +Assembly aborted with 28 errors! diff --git a/test/asm/builtin-reserved.err b/test/asm/builtin-reserved.err index d51347c3..f6c46fcd 100644 --- a/test/asm/builtin-reserved.err +++ b/test/asm/builtin-reserved.err @@ -30,4 +30,4 @@ error: builtin-reserved.asm(29): '.' is reserved for a built-in symbol error: builtin-reserved.asm(32): "." has no value outside of a label scope -error: Assembly aborted (16 errors)! +Assembly aborted with 16 errors! diff --git a/test/asm/character-escape-at-end.err b/test/asm/character-escape-at-end.err index 78234958..65567a92 100644 --- a/test/asm/character-escape-at-end.err +++ b/test/asm/character-escape-at-end.err @@ -2,4 +2,4 @@ error: character-escape-at-end.asm(1): Illegal character escape at end of input error: character-escape-at-end.asm(1): Unterminated string -error: Assembly aborted (2 errors)! +Assembly aborted with 2 errors! diff --git a/test/asm/character-escapes.err b/test/asm/character-escapes.err index 536b1af3..472d444e 100644 --- a/test/asm/character-escapes.err +++ b/test/asm/character-escapes.err @@ -4,4 +4,4 @@ error: character-escapes.asm(10) -> character-escapes.asm::m(7): Invalid character in bracketed macro argument '\' error: character-escapes.asm(10) -> character-escapes.asm::m(8): Invalid character in bracketed macro argument '\t' -error: Assembly aborted (3 errors)! +Assembly aborted with 3 errors! diff --git a/test/asm/charmap-empty.err b/test/asm/charmap-empty.err index 2ec188aa..96ffc11f 100644 --- a/test/asm/charmap-empty.err +++ b/test/asm/charmap-empty.err @@ -2,4 +2,4 @@ error: charmap-empty.asm(1): Cannot map an empty string error: charmap-empty.asm(2): syntax error, unexpected end of line -error: Assembly aborted (2 errors)! +Assembly aborted with 2 errors! diff --git a/test/asm/charmap-inheritance.err b/test/asm/charmap-inheritance.err index 2bc3ba51..d5a04c29 100644 --- a/test/asm/charmap-inheritance.err +++ b/test/asm/charmap-inheritance.err @@ -1,3 +1,3 @@ error: charmap-inheritance.asm(26): Base charmap 'eggs' doesn't exist -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/charsize.err b/test/asm/charsize.err index ad026a13..f2725834 100644 --- a/test/asm/charsize.err +++ b/test/asm/charsize.err @@ -6,4 +6,4 @@ error: charsize.asm(19): CHARSIZE: No character mapping for "abcdef" error: charsize.asm(20): CHARSIZE: No character mapping for "é" -error: Assembly aborted (4 errors)! +Assembly aborted with 4 errors! diff --git a/test/asm/charval.err b/test/asm/charval.err index cf16c9f1..8087ed90 100644 --- a/test/asm/charval.err +++ b/test/asm/charval.err @@ -8,4 +8,4 @@ warning: charval.asm(22): [-Wbuiltin-args] CHARVAL: Index starts at 0 warning: charval.asm(23): [-Wbuiltin-args] CHARVAL: Index 10 is past the end of the character mapping -error: Assembly aborted (3 errors)! +Assembly aborted with 3 errors! diff --git a/test/asm/code-after-endm-endr-endc.err b/test/asm/code-after-endm-endr-endc.err index 0220c1a5..41a6fdad 100644 --- a/test/asm/code-after-endm-endr-endc.err +++ b/test/asm/code-after-endm-endr-endc.err @@ -12,4 +12,4 @@ error: code-after-endm-endr-endc.asm(23): syntax error, unexpected PRINTLN, expecting end of line error: code-after-endm-endr-endc.asm(25): syntax error, unexpected PRINTLN, expecting end of line or end of buffer -error: Assembly aborted (7 errors)! +Assembly aborted with 7 errors! diff --git a/test/asm/command-line-symbols.err b/test/asm/command-line-symbols.err index 07f7ba78..fcc080bd 100644 --- a/test/asm/command-line-symbols.err +++ b/test/asm/command-line-symbols.err @@ -1,4 +1,4 @@ error: command-line-symbols.asm(3): 'FOO' already defined at (should it be {interpolated} to define its contents "hello"?) -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/compound-assignment.err b/test/asm/compound-assignment.err index 1d7fc2c9..35f817fe 100644 --- a/test/asm/compound-assignment.err +++ b/test/asm/compound-assignment.err @@ -1,3 +1,3 @@ error: compound-assignment.asm(35): Expected constant expression: 'UnDeFiNeD' is not constant at assembly time -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/const-and.err b/test/asm/const-and.err index b032e0ab..890fe9b5 100644 --- a/test/asm/const-and.err +++ b/test/asm/const-and.err @@ -6,4 +6,4 @@ error: const-and.asm(17): Expected constant expression: PC is not constant at assembly time error: const-and.asm(20): Expected constant expression: 'Floating' is not constant at assembly time -error: Assembly aborted (4 errors)! +Assembly aborted with 4 errors! diff --git a/test/asm/const-not.err b/test/asm/const-not.err index 9c34779c..98871622 100644 --- a/test/asm/const-not.err +++ b/test/asm/const-not.err @@ -1,3 +1,3 @@ error: const-not.asm(3): Assertion failed -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/const-zero.err b/test/asm/const-zero.err index 8308f857..fd2f297b 100644 --- a/test/asm/const-zero.err +++ b/test/asm/const-zero.err @@ -1,3 +1,3 @@ error: const-zero.asm(21) -> const-zero.asm::test_or(14): Expected constant expression: PC is not constant at assembly time -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/data-in-ram.err b/test/asm/data-in-ram.err index b3bb9d81..5b0fb0f6 100644 --- a/test/asm/data-in-ram.err +++ b/test/asm/data-in-ram.err @@ -2,4 +2,4 @@ error: data-in-ram.asm(2): Section 'code' cannot contain code or data (not ROM0 or ROMX) error: data-in-ram.asm(4): Section 'data' cannot contain code or data (not ROM0 or ROMX) -error: Assembly aborted (2 errors)! +Assembly aborted with 2 errors! diff --git a/test/asm/def-scoped.err b/test/asm/def-scoped.err index f357e2a7..43486134 100644 --- a/test/asm/def-scoped.err +++ b/test/asm/def-scoped.err @@ -4,4 +4,4 @@ error: def-scoped.asm(13): syntax error, unexpected local label, expecting symbol error: def-scoped.asm(16): syntax error, unexpected local label, expecting symbol -error: Assembly aborted (3 errors)! +Assembly aborted with 3 errors! diff --git a/test/asm/def.err b/test/asm/def.err index de6196b3..80d80ff0 100644 --- a/test/asm/def.err +++ b/test/asm/def.err @@ -8,4 +8,4 @@ error: def.asm(38): error: def.asm(42): 'name' already defined at def.asm(40) (should it be {interpolated} to define its contents "mac2"?) -error: Assembly aborted (4 errors)! +Assembly aborted with 4 errors! diff --git a/test/asm/diff-marks.err b/test/asm/diff-marks.err index 741e6d9e..994ea1c0 100644 --- a/test/asm/diff-marks.err +++ b/test/asm/diff-marks.err @@ -2,4 +2,4 @@ error: diff-marks.asm(2): syntax error, unexpected - at the beginning of the line (is it a leftover diff mark?) error: diff-marks.asm(3): syntax error, unexpected + at the beginning of the line (is it a leftover diff mark?) -error: Assembly aborted (2 errors)! +Assembly aborted with 2 errors! diff --git a/test/asm/double-purge.err b/test/asm/double-purge.err index 75092f64..5ab25c17 100644 --- a/test/asm/double-purge.err +++ b/test/asm/double-purge.err @@ -1,3 +1,3 @@ error: double-purge.asm(3): 'n' was already purged -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/ds-bad.err b/test/asm/ds-bad.err index dba29b84..db82be8d 100644 --- a/test/asm/ds-bad.err +++ b/test/asm/ds-bad.err @@ -2,4 +2,4 @@ error: ds-bad.asm(3): Expected constant expression: 'unknown' is not constant at assembly time warning: ds-bad.asm(4): [-Wtruncation] Expression must be 8-bit; use LOW() to force 8-bit -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/empty-raw-identifier.err b/test/asm/empty-raw-identifier.err index ad10640c..1c39a6b6 100644 --- a/test/asm/empty-raw-identifier.err +++ b/test/asm/empty-raw-identifier.err @@ -2,4 +2,4 @@ error: empty-raw-identifier.asm(5) -> empty-raw-identifier.asm::macro(3): Invalid character in bracketed macro argument '?' error: empty-raw-identifier.asm(5) -> empty-raw-identifier.asm::macro(3): Empty raw symbol in bracketed macro argument -error: Assembly aborted (2 errors)! +Assembly aborted with 2 errors! diff --git a/test/asm/endsection-in-load.err b/test/asm/endsection-in-load.err index 1de10bb3..be5ca97a 100644 --- a/test/asm/endsection-in-load.err +++ b/test/asm/endsection-in-load.err @@ -2,4 +2,4 @@ warning: endsection-in-load.asm(3): [-Wunterminated-load] `LOAD` block without `ENDL` terminated by `ENDSECTION` error: endsection-in-load.asm(4): Found `ENDL` outside of a `LOAD` block -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/endsection.err b/test/asm/endsection.err index 64f1656c..7aedb551 100644 --- a/test/asm/endsection.err +++ b/test/asm/endsection.err @@ -1,3 +1,3 @@ error: endsection.asm(4): Cannot output data outside of a SECTION -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/error-limit.err b/test/asm/error-limit.err index 8680aa3c..3cb2ce0e 100644 --- a/test/asm/error-limit.err +++ b/test/asm/error-limit.err @@ -1,3 +1,3 @@ error: error-limit.asm(2): 'x' already defined at error-limit.asm(1) -error: The maximum of 1 error was reached (configure with "-X/--max-errors"); assembly aborted! +Assembly aborted after the maximum of 1 error! (configure with '-X/--max-errors') diff --git a/test/asm/error-recovery.err b/test/asm/error-recovery.err index 1166f948..59cfea06 100644 --- a/test/asm/error-recovery.err +++ b/test/asm/error-recovery.err @@ -6,4 +6,4 @@ error: error-recovery.asm(5) -> error-recovery.asm::REPT~2(7): syntax error, unexpected symbol error: error-recovery.asm(5) -> error-recovery.asm::REPT~3(7): syntax error, unexpected symbol -error: Assembly aborted (4 errors)! +Assembly aborted with 4 errors! diff --git a/test/asm/expand-empty-string.err b/test/asm/expand-empty-string.err index fd285b10..d4072230 100644 --- a/test/asm/expand-empty-string.err +++ b/test/asm/expand-empty-string.err @@ -1,3 +1,3 @@ error: expand-empty-string.asm(6) -> expand-empty-string.asm::test(4): syntax error, unexpected number -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/export.err b/test/asm/export.err index 17dba4fa..d7d14359 100644 --- a/test/asm/export.err +++ b/test/asm/export.err @@ -1,3 +1,3 @@ error: export.asm(18): syntax error, unexpected EQUS -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/ff00+c-bad.err b/test/asm/ff00+c-bad.err index 2fc4c604..4701c4ee 100644 --- a/test/asm/ff00+c-bad.err +++ b/test/asm/ff00+c-bad.err @@ -4,4 +4,4 @@ error: ff00+c-bad.asm(9): Expected constant expression: 'xyz' is not constant at assembly time error: ff00+c-bad.asm(9): Base value must be equal to $FF00 for $FF00+C -error: Assembly aborted (3 errors)! +Assembly aborted with 3 errors! diff --git a/test/asm/fixed-oob.err b/test/asm/fixed-oob.err index f28e15c1..a9d2ca52 100644 --- a/test/asm/fixed-oob.err +++ b/test/asm/fixed-oob.err @@ -12,4 +12,4 @@ error: fixed-oob.asm(13): Section "OAM"'s fixed address $0cab is outside of range [$fe00; $fe9f] error: fixed-oob.asm(15): Section "HRAM"'s fixed address $0bad is outside of range [$ff80; $fffe] -error: Assembly aborted (7 errors)! +Assembly aborted with 7 errors! diff --git a/test/asm/fixed-point-precision.err b/test/asm/fixed-point-precision.err index d18d7c94..86b76680 100644 --- a/test/asm/fixed-point-precision.err +++ b/test/asm/fixed-point-precision.err @@ -2,4 +2,4 @@ error: fixed-point-precision.asm(22): Fixed-point constant precision must be between 1 and 31 error: fixed-point-precision.asm(23): Fixed-point constant precision 0 invalid, defaulting to 16 -error: Assembly aborted (2 errors)! +Assembly aborted with 2 errors! diff --git a/test/asm/for-loop-variable.err b/test/asm/for-loop-variable.err index b8893821..806d1011 100644 --- a/test/asm/for-loop-variable.err +++ b/test/asm/for-loop-variable.err @@ -1,3 +1,3 @@ error: for-loop-variable.asm(12): 'y' already defined as constant at for-loop-variable.asm(8) -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/format-truncation.err b/test/asm/format-truncation.err index f583dd1a..28b85eb8 100644 --- a/test/asm/format-truncation.err +++ b/test/asm/format-truncation.err @@ -2,4 +2,4 @@ error: format-truncation.asm(9): Fractional width 260 too long, limiting to 255 error: format-truncation.asm(15): Fractional width 260 too long, limiting to 255 -error: Assembly aborted (2 errors)! +Assembly aborted with 2 errors! diff --git a/test/asm/fragment-align.err b/test/asm/fragment-align.err index d28f2da2..02d600c1 100644 --- a/test/asm/fragment-align.err +++ b/test/asm/fragment-align.err @@ -1,3 +1,3 @@ error: fragment-align.asm(25): Section is misaligned ($0004 bytes into the section, expected ALIGN[2, 0], got ALIGN[2, 1]) -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/garbage_char.err b/test/asm/garbage_char.err index c9506e34..a5e52833 100644 --- a/test/asm/garbage_char.err +++ b/test/asm/garbage_char.err @@ -1,3 +1,3 @@ error: garbage_char.asm(1): Unknown character 0xFF -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/garbage_sequence.err b/test/asm/garbage_sequence.err index 3add6895..69abd8c1 100644 --- a/test/asm/garbage_sequence.err +++ b/test/asm/garbage_sequence.err @@ -8,4 +8,4 @@ error: garbage_sequence.asm(3): Unknown character '#' error: garbage_sequence.asm(3): Unknown characters '#', '?', '?' -error: Assembly aborted (5 errors)! +Assembly aborted with 5 errors! diff --git a/test/asm/impossible-bank.err b/test/asm/impossible-bank.err index 60e156f5..b0938fb4 100644 --- a/test/asm/impossible-bank.err +++ b/test/asm/impossible-bank.err @@ -1,3 +1,3 @@ error: impossible-bank.asm(1): BANK only allowed for ROMX, WRAMX, SRAM, or VRAM sections -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/incbin-empty-bad.err b/test/asm/incbin-empty-bad.err index f23c9f2c..db1a7f96 100644 --- a/test/asm/incbin-empty-bad.err +++ b/test/asm/incbin-empty-bad.err @@ -1,3 +1,3 @@ error: incbin-empty-bad.asm(3): Specified range in INCBIN file 'empty.bin' is out of bounds (0 + 1 > 0) -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/incbin-end-0.err b/test/asm/incbin-end-0.err index d64f9531..c06676ce 100644 --- a/test/asm/incbin-end-0.err +++ b/test/asm/incbin-end-0.err @@ -1,3 +1,3 @@ error: incbin-end-0.asm(1): Cannot output data outside of a SECTION -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/incbin-end-bad.err b/test/asm/incbin-end-bad.err index c9b4add6..4673eec6 100644 --- a/test/asm/incbin-end-bad.err +++ b/test/asm/incbin-end-bad.err @@ -1,3 +1,3 @@ error: incbin-end-bad.asm(3): Specified range in INCBIN file 'data.bin' is out of bounds (123 + 1 > 123) -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/interpolation-overflow.err b/test/asm/interpolation-overflow.err index 297f83bd..5b8bf1c2 100644 --- a/test/asm/interpolation-overflow.err +++ b/test/asm/interpolation-overflow.err @@ -7,4 +7,4 @@ error: interpolation-overflow.asm(4): '\1' cannot be used outside of a macro error: interpolation-overflow.asm(4): syntax error, unexpected number -error: Assembly aborted (3 errors)! +Assembly aborted with 3 errors! diff --git a/test/asm/interpolation.err b/test/asm/interpolation.err index 06ce79ba..21c5cfdb 100644 --- a/test/asm/interpolation.err +++ b/test/asm/interpolation.err @@ -6,4 +6,4 @@ error: interpolation.asm(29): Interpolated symbol "foo" is not a numeric or string symbol error: interpolation.asm(32): Interpolated symbol "xor" is a reserved keyword; add a '#' prefix to use it as a raw symbol -error: Assembly aborted (4 errors)! +Assembly aborted with 4 errors! diff --git a/test/asm/invalid-alignment.err b/test/asm/invalid-alignment.err index b7892b4f..805064eb 100644 --- a/test/asm/invalid-alignment.err +++ b/test/asm/invalid-alignment.err @@ -12,4 +12,4 @@ error: invalid-alignment.asm(21): Section "e"'s fixed address doesn't match its alignment error: invalid-alignment.asm(23): Section "f"'s fixed address doesn't match its alignment -error: Assembly aborted (7 errors)! +Assembly aborted with 7 errors! diff --git a/test/asm/invalid-bank.err b/test/asm/invalid-bank.err index 784aee3a..f46d858c 100644 --- a/test/asm/invalid-bank.err +++ b/test/asm/invalid-bank.err @@ -1,3 +1,3 @@ error: invalid-bank.asm(1): VRAM bank value $0002 out of range ($0000 to $0001) -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/invalid-empty-macro-arg.err b/test/asm/invalid-empty-macro-arg.err index 6f300ad8..62e61e12 100644 --- a/test/asm/invalid-empty-macro-arg.err +++ b/test/asm/invalid-empty-macro-arg.err @@ -1,3 +1,3 @@ error: invalid-empty-macro-arg.asm(1): Empty bracketed macro argument -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/invalid-format.err b/test/asm/invalid-format.err index d113009d..22901422 100644 --- a/test/asm/invalid-format.err +++ b/test/asm/invalid-format.err @@ -28,4 +28,4 @@ error: invalid-format.asm(17): Formatting type 'd' with fractional width error: invalid-format.asm(18): Formatting type 'd' with fractional precision -error: Assembly aborted (15 errors)! +Assembly aborted with 15 errors! diff --git a/test/asm/invalid-instructions.err b/test/asm/invalid-instructions.err index efc6232a..7eaa4144 100644 --- a/test/asm/invalid-instructions.err +++ b/test/asm/invalid-instructions.err @@ -32,4 +32,4 @@ error: invalid-instructions.asm(20): syntax error, unexpected af error: invalid-instructions.asm(21): syntax error, unexpected af -error: Assembly aborted (16 errors)! +Assembly aborted with 16 errors! diff --git a/test/asm/invalid-jr.err b/test/asm/invalid-jr.err index 0b2cd9ed..42cf9c37 100644 --- a/test/asm/invalid-jr.err +++ b/test/asm/invalid-jr.err @@ -1,3 +1,3 @@ error: invalid-jr.asm(3): JR target must be between -128 and 127 bytes away, not -258; use JP instead -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/invalid-macro-arg-character.err b/test/asm/invalid-macro-arg-character.err index b81cca3f..94fb75c2 100644 --- a/test/asm/invalid-macro-arg-character.err +++ b/test/asm/invalid-macro-arg-character.err @@ -2,4 +2,4 @@ error: invalid-macro-arg-character.asm(1): Invalid character in bracketed macro argument '!' error: invalid-macro-arg-character.asm(1): syntax error, unexpected > -error: Assembly aborted (2 errors)! +Assembly aborted with 2 errors! diff --git a/test/asm/invalid-macro-arg-symbol.err b/test/asm/invalid-macro-arg-symbol.err index 76a780cb..7511409b 100644 --- a/test/asm/invalid-macro-arg-symbol.err +++ b/test/asm/invalid-macro-arg-symbol.err @@ -1,3 +1,3 @@ error: invalid-macro-arg-symbol.asm(1): Bracketed symbol "foo" does not exist -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/invalid-numbers.err b/test/asm/invalid-numbers.err index f2730b31..d455e30b 100644 --- a/test/asm/invalid-numbers.err +++ b/test/asm/invalid-numbers.err @@ -22,4 +22,4 @@ error: invalid-numbers.asm(16): Invalid fixed-point constant, no significant digits after 'q' error: invalid-numbers.asm(19): Fixed-point constant precision must be between 1 and 31 -error: Assembly aborted (7 errors)! +Assembly aborted with 7 errors! diff --git a/test/asm/invalid-opt.err b/test/asm/invalid-opt.err index d59ac770..32400fac 100644 --- a/test/asm/invalid-opt.err +++ b/test/asm/invalid-opt.err @@ -36,4 +36,4 @@ error: invalid-opt.asm(18): syntax error, unexpected end of line, expecting string error: invalid-opt.asm(19): No entries in the option stack -error: Assembly aborted (19 errors)! +Assembly aborted with 19 errors! diff --git a/test/asm/invalid-union.err b/test/asm/invalid-union.err index afd00a5c..dceb924b 100644 --- a/test/asm/invalid-union.err +++ b/test/asm/invalid-union.err @@ -6,4 +6,4 @@ error: invalid-union.asm(3): UNIONs must be inside a SECTION error: invalid-union.asm(7): Unterminated UNION construct -error: Assembly aborted (4 errors)! +Assembly aborted with 4 errors! diff --git a/test/asm/invalid-utf-8-strings.err b/test/asm/invalid-utf-8-strings.err index 6cf13848..6a07ff32 100644 --- a/test/asm/invalid-utf-8-strings.err +++ b/test/asm/invalid-utf-8-strings.err @@ -58,4 +58,4 @@ error: invalid-utf-8-strings.asm(54): STRSUB: Incomplete UTF-8 character error: invalid-utf-8-strings.asm(57): STRSLICE: Incomplete UTF-8 character -error: Assembly aborted (30 errors)! +Assembly aborted with 30 errors! diff --git a/test/asm/invalid-utf-8.err b/test/asm/invalid-utf-8.err index 0dd97036..b8026ad5 100644 --- a/test/asm/invalid-utf-8.err +++ b/test/asm/invalid-utf-8.err @@ -1,3 +1,3 @@ error: invalid-utf-8.asm(6) -> invalid-utf-8.asm::m(4): Unknown characters 0xCF, 0xD3 -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/isconst.err b/test/asm/isconst.err index 261d849f..8d938f04 100644 --- a/test/asm/isconst.err +++ b/test/asm/isconst.err @@ -10,4 +10,4 @@ error: isconst.asm(28) -> isconst.asm::test_expr(9): Expected constant expression: 'FloatingLabel' is not constant at assembly time warning: isconst.asm(29) -> isconst.asm::test_expr(10): [-Wuser] Test #6: Compile-time constant -error: Assembly aborted (2 errors)! +Assembly aborted with 2 errors! diff --git a/test/asm/label-diff.err b/test/asm/label-diff.err index 916b6d22..45c5f336 100644 --- a/test/asm/label-diff.err +++ b/test/asm/label-diff.err @@ -34,4 +34,4 @@ error: label-diff.asm(58) -> label-diff.asm::print_diff(19): Expected constant expression: 'Unknown' is not constant at assembly time error: label-diff.asm(58) -> label-diff.asm::print_diff(20): Expected constant expression: PC is not constant at assembly time -error: Assembly aborted (18 errors)! +Assembly aborted with 18 errors! diff --git a/test/asm/label-macro-arg.err b/test/asm/label-macro-arg.err index 39f1e2cb..24b4e57b 100644 --- a/test/asm/label-macro-arg.err +++ b/test/asm/label-macro-arg.err @@ -14,4 +14,4 @@ error: label-macro-arg.asm(39) -> label-macro-arg.asm::test_char(29): Invalid format spec 'sizeof_' error: label-macro-arg.asm(39) -> label-macro-arg.asm::test_char(29): Interpolated symbol "something" does not exist -error: Assembly aborted (7 errors)! +Assembly aborted with 7 errors! diff --git a/test/asm/label-outside-section.err b/test/asm/label-outside-section.err index 71ab7e3f..4b1b4952 100644 --- a/test/asm/label-outside-section.err +++ b/test/asm/label-outside-section.err @@ -1,3 +1,3 @@ error: label-outside-section.asm(1): Label "bad" created outside of a SECTION -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/label-redefinition.err b/test/asm/label-redefinition.err index 74733c78..dddf5690 100644 --- a/test/asm/label-redefinition.err +++ b/test/asm/label-redefinition.err @@ -1,3 +1,3 @@ error: label-redefinition.asm(7): 'Sym' already defined at label-redefinition.asm(6) -> label-redefinition.asm::m(4) -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/label-scope.err b/test/asm/label-scope.err index 59a09d77..bd1b9bb6 100644 --- a/test/asm/label-scope.err +++ b/test/asm/label-scope.err @@ -10,4 +10,4 @@ error: label-scope.asm(12): Built-in symbol '.' cannot be purged error: label-scope.asm(12): Built-in symbol '..' cannot be purged -error: Assembly aborted (6 errors)! +Assembly aborted with 6 errors! diff --git a/test/asm/lexer-hack.err b/test/asm/lexer-hack.err index 1b3bbd4f..854f58e0 100644 --- a/test/asm/lexer-hack.err +++ b/test/asm/lexer-hack.err @@ -6,4 +6,4 @@ error: lexer-hack.asm(27): Macro "undef" not defined error: lexer-hack.asm(28): Macro "undef" not defined -error: Assembly aborted (4 errors)! +Assembly aborted with 4 errors! diff --git a/test/asm/line-continuation-whitespace.err b/test/asm/line-continuation-whitespace.err index 6989fd03..9b8514f0 100644 --- a/test/asm/line-continuation-whitespace.err +++ b/test/asm/line-continuation-whitespace.err @@ -1,3 +1,3 @@ error: line-continuation-whitespace.asm(7): Label "foo" created outside of a SECTION -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/line-continuation.err b/test/asm/line-continuation.err index 416709c6..6eb2b979 100644 --- a/test/asm/line-continuation.err +++ b/test/asm/line-continuation.err @@ -4,4 +4,4 @@ warning: line-continuation.asm(6) -> line-continuation.asm::spam(4): [-Wuser] spam error: line-continuation.asm(14): Label "foo" created outside of a SECTION -error: Assembly aborted (2 errors)! +Assembly aborted with 2 errors! diff --git a/test/asm/load-in-load.err b/test/asm/load-in-load.err index e42cb8df..48f17949 100644 --- a/test/asm/load-in-load.err +++ b/test/asm/load-in-load.err @@ -2,4 +2,4 @@ warning: load-in-load.asm(3): [-Wunterminated-load] `LOAD` block without `ENDL` terminated by `LOAD` error: load-in-load.asm(5): Found `ENDL` outside of a `LOAD` block -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/load-overflow.err b/test/asm/load-overflow.err index b7fcecd5..a1cf96a0 100644 --- a/test/asm/load-overflow.err +++ b/test/asm/load-overflow.err @@ -12,4 +12,4 @@ error: load-overflow.asm(26): Section 'hmm' grew too big (max size = 0x2000 bytes, reached 0x4000) error: load-overflow.asm(26): Section 'lol' grew too big (max size = 0x2000 bytes, reached 0x3000) -error: Assembly aborted (5 errors)! +Assembly aborted with 5 errors! diff --git a/test/asm/load-rom.err b/test/asm/load-rom.err index 9f60321a..c9473ac0 100644 --- a/test/asm/load-rom.err +++ b/test/asm/load-rom.err @@ -2,4 +2,4 @@ error: load-rom.asm(3): `LOAD` blocks cannot create a ROM section error: load-rom.asm(5): Found `ENDL` outside of a `LOAD` block -error: Assembly aborted (2 errors)! +Assembly aborted with 2 errors! diff --git a/test/asm/local-purge.err b/test/asm/local-purge.err index 5857c42f..91b19562 100644 --- a/test/asm/local-purge.err +++ b/test/asm/local-purge.err @@ -2,4 +2,4 @@ warning: local-purge.asm(7): [-Wpurge] Purging a label ".loc" error: local-purge.asm(8): Interpolated symbol ".loc" does not exist; it was purged -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/macro-@.err b/test/asm/macro-@.err index 653fce1f..71c624d0 100644 --- a/test/asm/macro-@.err +++ b/test/asm/macro-@.err @@ -2,4 +2,4 @@ error: macro-@.asm(1): Label "foo" created outside of a SECTION error: macro-@.asm(1): "@" is not a macro -error: Assembly aborted (2 errors)! +Assembly aborted with 2 errors! diff --git a/test/asm/macro-arg-0.err b/test/asm/macro-arg-0.err index 136a5c8c..d546dd9b 100644 --- a/test/asm/macro-arg-0.err +++ b/test/asm/macro-arg-0.err @@ -2,4 +2,4 @@ error: macro-arg-0.asm(5) -> macro-arg-0.asm::m(2): Begun line continuation, but encountered character '0' error: macro-arg-0.asm(5) -> macro-arg-0.asm::m(3): Invalid bracketed macro argument '\<0>' -error: Assembly aborted (2 errors)! +Assembly aborted with 2 errors! diff --git a/test/asm/macro-arg-illegal-escape.err b/test/asm/macro-arg-illegal-escape.err index c7ca0196..9310b62e 100644 --- a/test/asm/macro-arg-illegal-escape.err +++ b/test/asm/macro-arg-illegal-escape.err @@ -2,4 +2,4 @@ error: macro-arg-illegal-escape.asm(5): Illegal character escape 'w' error: macro-arg-illegal-escape.asm(5): Illegal character escape at end of input -error: Assembly aborted (2 errors)! +Assembly aborted with 2 errors! diff --git a/test/asm/macro-arg-in-string.err b/test/asm/macro-arg-in-string.err index c64b6fbe..12301baf 100644 --- a/test/asm/macro-arg-in-string.err +++ b/test/asm/macro-arg-in-string.err @@ -1,3 +1,3 @@ error: macro-arg-in-string.asm(12): Illegal character escape '!' -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/macro-args-outside-macro.err b/test/asm/macro-args-outside-macro.err index 0612739e..acfea0eb 100644 --- a/test/asm/macro-args-outside-macro.err +++ b/test/asm/macro-args-outside-macro.err @@ -4,4 +4,4 @@ error: macro-args-outside-macro.asm(2): '\<2>' cannot be used outside of a macro error: macro-args-outside-macro.asm(3): '\#' cannot be used outside of a macro -error: Assembly aborted (3 errors)! +Assembly aborted with 3 errors! diff --git a/test/asm/macro-syntax.err b/test/asm/macro-syntax.err index 1142403e..47c5306f 100644 --- a/test/asm/macro-syntax.err +++ b/test/asm/macro-syntax.err @@ -8,4 +8,4 @@ error: macro-syntax.asm(9): syntax error, unexpected ENDM error: macro-syntax.asm(11): "old" is not a macro -error: Assembly aborted (5 errors)! +Assembly aborted with 5 errors! diff --git a/test/asm/max-errors.err b/test/asm/max-errors.err index de22fb6e..4ad1d7be 100644 --- a/test/asm/max-errors.err +++ b/test/asm/max-errors.err @@ -1,3 +1,3 @@ error: max-errors.asm(3): Expected constant expression: PC is not constant at assembly time -error: The maximum of 1 error was reached (configure with "-X/--max-errors"); assembly aborted! +Assembly aborted after the maximum of 1 error! (configure with '-X/--max-errors') diff --git a/test/asm/multi-line-strings.err b/test/asm/multi-line-strings.err index a1983e91..3a20bb42 100644 --- a/test/asm/multi-line-strings.err +++ b/test/asm/multi-line-strings.err @@ -2,4 +2,4 @@ error: multi-line-strings.asm(23): Unterminated string warning: multi-line-strings.asm(35): [-Wuser] check the line number -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/multiple-charmaps.err b/test/asm/multiple-charmaps.err index 511e2896..852bc90a 100644 --- a/test/asm/multiple-charmaps.err +++ b/test/asm/multiple-charmaps.err @@ -18,4 +18,4 @@ error: multiple-charmaps.asm(108) -> multiple-charmaps.asm::set_(15): Charmap 'map5' doesn't exist error: multiple-charmaps.asm(110) -> multiple-charmaps.asm::pop_(30): No entries in the charmap stack -error: Assembly aborted (3 errors)! +Assembly aborted with 3 errors! diff --git a/test/asm/negative-macro-args.err b/test/asm/negative-macro-args.err index 827e342f..8bed3357 100644 --- a/test/asm/negative-macro-args.err +++ b/test/asm/negative-macro-args.err @@ -23,4 +23,4 @@ while expanding symbol "2147483648" error: negative-macro-args.asm(21) -> negative-macro-args.asm::mac(18): Number in bracketed macro argument is too large while expanding symbol "4294967295" -error: Assembly aborted (11 errors)! +Assembly aborted with 11 errors! diff --git a/test/asm/nested-bad-interpolation.err b/test/asm/nested-bad-interpolation.err index 10a6022a..7ba3b696 100644 --- a/test/asm/nested-bad-interpolation.err +++ b/test/asm/nested-bad-interpolation.err @@ -14,4 +14,4 @@ error: nested-bad-interpolation.asm(3): Interpolated symbol "" does not exist warning: nested-bad-interpolation.asm(3): [-Wobsolete] Treating multi-unit strings as numbers is deprecated -error: Assembly aborted (6 errors)! +Assembly aborted with 6 errors! diff --git a/test/asm/nested-brackets.err b/test/asm/nested-brackets.err index 10de1799..6ede0e0b 100644 --- a/test/asm/nested-brackets.err +++ b/test/asm/nested-brackets.err @@ -1,3 +1,3 @@ error: nested-brackets.asm(5): Missing } -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/nested-expansions.err b/test/asm/nested-expansions.err index 067e2111..3ab7f904 100644 --- a/test/asm/nested-expansions.err +++ b/test/asm/nested-expansions.err @@ -1,3 +1,3 @@ error: nested-expansions.asm(6) -> nested-expansions.asm::test(4): Macro "qux" not defined -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/nested-macrodef.err b/test/asm/nested-macrodef.err index 89514893..070a51b4 100644 --- a/test/asm/nested-macrodef.err +++ b/test/asm/nested-macrodef.err @@ -4,4 +4,4 @@ error: nested-macrodef.asm(26) -> nested-macrodef.asm::outer(24): Unterminated macro definition error: nested-macrodef.asm(27): Macro "inner" not defined -error: Assembly aborted (2 errors)! +Assembly aborted with 2 errors! diff --git a/test/asm/non-numeric-symbol.err b/test/asm/non-numeric-symbol.err index 17a31e79..03a4a0c4 100644 --- a/test/asm/non-numeric-symbol.err +++ b/test/asm/non-numeric-symbol.err @@ -10,4 +10,4 @@ error: non-numeric-symbol.asm(10): 'mac' is not a numeric symbol error: non-numeric-symbol.asm(11): 'mac' is not a numeric symbol -error: Assembly aborted (6 errors)! +Assembly aborted with 6 errors! diff --git a/test/asm/nonexist-include.err b/test/asm/nonexist-include.err index 50d7c6e4..e83bd20c 100644 --- a/test/asm/nonexist-include.err +++ b/test/asm/nonexist-include.err @@ -1,3 +1,3 @@ error: nonexist-include.asm(1): Unable to open included file 'nonexist-include.inc': No such file or directory -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/notexist.err b/test/asm/notexist.err index fce6c89f..e8836cdf 100644 --- a/test/asm/notexist.err +++ b/test/asm/notexist.err @@ -1,4 +1 @@ -error: at top level: - Failed to stat file "notexist.asm": No such file or directory -FATAL: at top level: - Failed to open main file +FATAL: Failed to stat file "notexist.asm": No such file or directory diff --git a/test/asm/null-in-macro.err b/test/asm/null-in-macro.err index 927dc560..206c4d29 100644 --- a/test/asm/null-in-macro.err +++ b/test/asm/null-in-macro.err @@ -1,3 +1,3 @@ error: null-in-macro.asm(4) -> null-in-macro.asm::foo(2): Unknown character '\0' -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/null-outside-string.err b/test/asm/null-outside-string.err index 03d39622..6b170a41 100644 --- a/test/asm/null-outside-string.err +++ b/test/asm/null-outside-string.err @@ -14,4 +14,4 @@ error: null-outside-string.asm(7): Begun line continuation, but encountered character 'X' error: null-outside-string.asm(7): syntax error, unexpected symbol -error: Assembly aborted (8 errors)! +Assembly aborted with 8 errors! diff --git a/test/asm/opt-Q.err b/test/asm/opt-Q.err index ee7501ff..bb48def1 100644 --- a/test/asm/opt-Q.err +++ b/test/asm/opt-Q.err @@ -2,4 +2,4 @@ error: opt-Q.asm(17) -> opt-Q.asm::test(3): Argument for option 'Q' must be between 1 and 31 error: opt-Q.asm(18) -> opt-Q.asm::test(3): Argument for option 'Q' must be between 1 and 31 -error: Assembly aborted (2 errors)! +Assembly aborted with 2 errors! diff --git a/test/asm/pc-bank.err b/test/asm/pc-bank.err index f3560c04..0c3789c8 100644 --- a/test/asm/pc-bank.err +++ b/test/asm/pc-bank.err @@ -2,4 +2,4 @@ error: pc-bank.asm(2): Source address $2a00 not between $FF00 to $FFFF error: pc-bank.asm(11): Expected constant expression: Current section's bank is not known -error: Assembly aborted (2 errors)! +Assembly aborted with 2 errors! diff --git a/test/asm/pops-restore-no-section.err b/test/asm/pops-restore-no-section.err index 3cd2925f..f0ed7b8e 100644 --- a/test/asm/pops-restore-no-section.err +++ b/test/asm/pops-restore-no-section.err @@ -2,4 +2,4 @@ error: pops-restore-no-section.asm(9): Label "DisallowedContent" created outside of a SECTION error: pops-restore-no-section.asm(10): Cannot output data outside of a SECTION -error: Assembly aborted (2 errors)! +Assembly aborted with 2 errors! diff --git a/test/asm/purge-ref.err b/test/asm/purge-ref.err index b6a65c9c..e2eab654 100644 --- a/test/asm/purge-ref.err +++ b/test/asm/purge-ref.err @@ -8,4 +8,4 @@ error: purge-ref.asm(15): Symbol "EvenLessOK" is referenced and thus cannot be purged warning: purge-ref.asm(23): [-Wpurge] Purging a label "Maybe" -error: Assembly aborted (3 errors)! +Assembly aborted with 3 errors! diff --git a/test/asm/purge-refs.err b/test/asm/purge-refs.err index 0ded8eb5..be5f092e 100644 --- a/test/asm/purge-refs.err +++ b/test/asm/purge-refs.err @@ -2,4 +2,4 @@ error: purge-refs.asm(6): Symbol "Floating" is referenced and thus cannot be purged warning: purge-refs.asm(13): [-Wpurge] Purging a label "Fixed" -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/purge.err b/test/asm/purge.err index 8061c2d6..4f50c25c 100644 --- a/test/asm/purge.err +++ b/test/asm/purge.err @@ -6,4 +6,4 @@ warning: purge.asm(12): [-Wpurge] Purging an exported symbol "Exported" error: purge.asm(15): 'Undefined' not defined -error: Assembly aborted (2 errors)! +Assembly aborted with 2 errors! diff --git a/test/asm/pushs.err b/test/asm/pushs.err index 6b5bdce2..51dcdc08 100644 --- a/test/asm/pushs.err +++ b/test/asm/pushs.err @@ -1,3 +1,3 @@ error: pushs.asm(5): Cannot output data outside of a SECTION -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/raw-macro-args.err b/test/asm/raw-macro-args.err index b9da9770..eb701293 100644 --- a/test/asm/raw-macro-args.err +++ b/test/asm/raw-macro-args.err @@ -6,4 +6,4 @@ error: raw-macro-args.asm(37): Unterminated string error: raw-macro-args.asm(38): Unterminated string -error: Assembly aborted (4 errors)! +Assembly aborted with 4 errors! diff --git a/test/asm/raw-string-symbol-errors.err b/test/asm/raw-string-symbol-errors.err index 2863df6f..4f1ae010 100644 --- a/test/asm/raw-string-symbol-errors.err +++ b/test/asm/raw-string-symbol-errors.err @@ -24,4 +24,4 @@ error: raw-string-symbol-errors.asm(27): 's' was already purged error: raw-string-symbol-errors.asm(29): 's' is not a string symbol -error: Assembly aborted (11 errors)! +Assembly aborted with 11 errors! diff --git a/test/asm/redef-equ.err b/test/asm/redef-equ.err index 7779a196..48a9dece 100644 --- a/test/asm/redef-equ.err +++ b/test/asm/redef-equ.err @@ -1,4 +1,4 @@ error: redef-equ.asm(25): 'N' already defined as non-EQU at redef-equ.asm(24) (should it be {interpolated} to define its contents "X"?) -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/redef-equs.err b/test/asm/redef-equs.err index 502d64ac..3bef371e 100644 --- a/test/asm/redef-equs.err +++ b/test/asm/redef-equs.err @@ -1,3 +1,3 @@ error: redef-equs.asm(25): 'N' already defined as non-EQUS at redef-equs.asm(24) -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/ref-override-bad.err b/test/asm/ref-override-bad.err index 3f0417f6..b27ad22d 100644 --- a/test/asm/ref-override-bad.err +++ b/test/asm/ref-override-bad.err @@ -2,4 +2,4 @@ error: ref-override-bad.asm(8): 'X' already referenced at ref-override-bad.asm(7) error: ref-override-bad.asm(13): 'Y' already referenced at ref-override-bad.asm(10) -error: Assembly aborted (2 errors)! +Assembly aborted with 2 errors! diff --git a/test/asm/reference-undefined-equs.err b/test/asm/reference-undefined-equs.err index f495b859..2612a099 100644 --- a/test/asm/reference-undefined-equs.err +++ b/test/asm/reference-undefined-equs.err @@ -2,4 +2,4 @@ error: reference-undefined-equs.asm(4): 's1' already referenced at reference-undefined-equs.asm(2) error: reference-undefined-equs.asm(5): 's2' already referenced at reference-undefined-equs.asm(2) -error: Assembly aborted (2 errors)! +Assembly aborted with 2 errors! diff --git a/test/asm/rept-shift.err b/test/asm/rept-shift.err index 5a75f25c..ccd95a73 100644 --- a/test/asm/rept-shift.err +++ b/test/asm/rept-shift.err @@ -4,4 +4,4 @@ warning: rept-shift.asm(15) -> rept-shift.asm::m(11): [-Wmacro-shift] Cannot shift macro arguments past their end error: rept-shift.asm(15) -> rept-shift.asm::m(12): Macro argument '\1' not defined -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/revchar.err b/test/asm/revchar.err index 9e70eee9..9d054193 100644 --- a/test/asm/revchar.err +++ b/test/asm/revchar.err @@ -2,4 +2,4 @@ error: revchar.asm(22) -> revchar.asm::test(13): REVCHAR: Multiple character mappings to values error: revchar.asm(23) -> revchar.asm::test(13): REVCHAR: No character mapping to values -error: Assembly aborted (2 errors)! +Assembly aborted with 2 errors! diff --git a/test/asm/rs-overwrite.err b/test/asm/rs-overwrite.err index a5abba1c..7c539324 100644 --- a/test/asm/rs-overwrite.err +++ b/test/asm/rs-overwrite.err @@ -8,4 +8,4 @@ error: rs-overwrite.asm(16): '_RS' already defined as non-EQU at rs-overwrite.asm(13) error: rs-overwrite.asm(19): '_RS' already defined as non-EQUS at rs-overwrite.asm(13) -error: Assembly aborted (5 errors)! +Assembly aborted with 5 errors! diff --git a/test/asm/section-in-load.err b/test/asm/section-in-load.err index 3bfda62f..f4d9b30c 100644 --- a/test/asm/section-in-load.err +++ b/test/asm/section-in-load.err @@ -2,4 +2,4 @@ warning: section-in-load.asm(3): [-Wunterminated-load] `LOAD` block without `ENDL` terminated by `SECTION` error: section-in-load.asm(4): Found `ENDL` outside of a `LOAD` block -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/section-sizeof-startof.err b/test/asm/section-sizeof-startof.err index 954c9cf3..12609130 100644 --- a/test/asm/section-sizeof-startof.err +++ b/test/asm/section-sizeof-startof.err @@ -8,4 +8,4 @@ error: section-sizeof-startof.asm(23): Expected constant expression: Section "sect2"'s start is not known error: section-sizeof-startof.asm(30): Expected constant expression: Section "sect3"'s size is not known -error: Assembly aborted (5 errors)! +Assembly aborted with 5 errors! diff --git a/test/asm/shift-outside-macro.err b/test/asm/shift-outside-macro.err index 2eba2b14..aa4cda4b 100644 --- a/test/asm/shift-outside-macro.err +++ b/test/asm/shift-outside-macro.err @@ -2,4 +2,4 @@ error: shift-outside-macro.asm(1): Cannot shift macro arguments outside of a macro error: shift-outside-macro.asm(2): Cannot shift macro arguments outside of a macro -error: Assembly aborted (2 errors)! +Assembly aborted with 2 errors! diff --git a/test/asm/skip-expansions.err b/test/asm/skip-expansions.err index 1e8e71ba..070e6975 100644 --- a/test/asm/skip-expansions.err +++ b/test/asm/skip-expansions.err @@ -4,4 +4,4 @@ error: skip-expansions.asm(31) -> skip-expansions.asm::mac2(21): syntax error, unexpected ( error: skip-expansions.asm(31) -> skip-expansions.asm::mac2(21): Macro argument '\2' not defined -error: Assembly aborted (3 errors)! +Assembly aborted with 3 errors! diff --git a/test/asm/strfmt.err b/test/asm/strfmt.err index af9a6376..abd5dd9e 100644 --- a/test/asm/strfmt.err +++ b/test/asm/strfmt.err @@ -8,4 +8,4 @@ error: strfmt.asm(26): STRFMT: Invalid format spec for argument 1 error: strfmt.asm(28): STRFMT: Not enough arguments for format spec, got: 1, need: 3 -error: Assembly aborted (5 errors)! +Assembly aborted with 5 errors! diff --git a/test/asm/string-concat.err b/test/asm/string-concat.err index cb6b813a..eab4a33b 100644 --- a/test/asm/string-concat.err +++ b/test/asm/string-concat.err @@ -2,4 +2,4 @@ error: string-concat.asm(25): syntax error, unexpected ++ error: string-concat.asm(26): syntax error, unexpected ++, expecting ] or + or - -error: Assembly aborted (2 errors)! +Assembly aborted with 2 errors! diff --git a/test/asm/string-literal-macro-arg.err b/test/asm/string-literal-macro-arg.err index 0066f05f..b00a3732 100644 --- a/test/asm/string-literal-macro-arg.err +++ b/test/asm/string-literal-macro-arg.err @@ -6,4 +6,4 @@ error: string-literal-macro-arg.asm(11): Unterminated string error: string-literal-macro-arg.asm(11) -> string-literal-macro-arg.asm::mac(4): Unterminated string -error: Assembly aborted (4 errors)! +Assembly aborted with 4 errors! diff --git a/test/asm/sym-collision.err b/test/asm/sym-collision.err index fd3d0461..02c95487 100644 --- a/test/asm/sym-collision.err +++ b/test/asm/sym-collision.err @@ -2,4 +2,4 @@ warning: sym-collision.asm(20): [-Wpurge] Purging a label "dork" error: sym-collision.asm(25): Interpolated symbol "dork" does not exist; it was purged -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/symbol-invalid-macro-arg.err b/test/asm/symbol-invalid-macro-arg.err index ec8922ad..f1536914 100644 --- a/test/asm/symbol-invalid-macro-arg.err +++ b/test/asm/symbol-invalid-macro-arg.err @@ -1,3 +1,3 @@ error: symbol-invalid-macro-arg.asm(1): Invalid bracketed macro argument '\<0>' -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/symbol-override.err b/test/asm/symbol-override.err index 9b08067a..bdb37265 100644 --- a/test/asm/symbol-override.err +++ b/test/asm/symbol-override.err @@ -4,4 +4,4 @@ error: symbol-override.asm(10): 'X' already defined as constant at symbol-override.asm(9) error: symbol-override.asm(14): 'Y' already defined as label at symbol-override.asm(13) -error: Assembly aborted (3 errors)! +Assembly aborted with 3 errors! diff --git a/test/asm/syntax-error-after-syntax-error.err b/test/asm/syntax-error-after-syntax-error.err index a41f723a..0961e78e 100644 --- a/test/asm/syntax-error-after-syntax-error.err +++ b/test/asm/syntax-error-after-syntax-error.err @@ -8,4 +8,4 @@ error: syntax-error-after-syntax-error.asm(9): syntax error, unexpected : error: syntax-error-after-syntax-error.asm(10): syntax error, unexpected stop, expecting end of line or end of buffer or :: -error: Assembly aborted (5 errors)! +Assembly aborted with 5 errors! diff --git a/test/asm/syntax-error-eof-newline.err b/test/asm/syntax-error-eof-newline.err index ab3b6f04..b6e562bf 100644 --- a/test/asm/syntax-error-eof-newline.err +++ b/test/asm/syntax-error-eof-newline.err @@ -1,3 +1,3 @@ error: syntax-error-eof-newline.asm(5) -> syntax-error-eof-newline.inc(1): syntax error, unexpected end of line -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/syntax-error-lexer-mode.err b/test/asm/syntax-error-lexer-mode.err index 319cbe01..de24bcaa 100644 --- a/test/asm/syntax-error-lexer-mode.err +++ b/test/asm/syntax-error-lexer-mode.err @@ -2,4 +2,4 @@ error: syntax-error-lexer-mode.asm(7): syntax error, unexpected af error: syntax-error-lexer-mode.asm(11): syntax error, unexpected af, expecting symbol -error: Assembly aborted (2 errors)! +Assembly aborted with 2 errors! diff --git a/test/asm/syntax-error.err b/test/asm/syntax-error.err index 6035315a..ff87fa32 100644 --- a/test/asm/syntax-error.err +++ b/test/asm/syntax-error.err @@ -1,3 +1,3 @@ error: syntax-error.asm(2): syntax error, unexpected a -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/undefined-builtins.err b/test/asm/undefined-builtins.err index c724ad86..06ecadda 100644 --- a/test/asm/undefined-builtins.err +++ b/test/asm/undefined-builtins.err @@ -14,4 +14,4 @@ error: undefined-builtins.asm(18): _NARG has no value outside of a macro error: undefined-builtins.asm(19): Interpolated symbol "_NARG" does not exist -error: Assembly aborted (8 errors)! +Assembly aborted with 8 errors! diff --git a/test/asm/undefined-opt.err b/test/asm/undefined-opt.err index 3c205072..fe78dab9 100644 --- a/test/asm/undefined-opt.err +++ b/test/asm/undefined-opt.err @@ -1,3 +1,3 @@ error: undefined-opt.asm(1): Unknown option 'x' -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/union-in-rom.err b/test/asm/union-in-rom.err index 0bd95f04..46624078 100644 --- a/test/asm/union-in-rom.err +++ b/test/asm/union-in-rom.err @@ -2,4 +2,4 @@ error: union-in-rom.asm(2): Cannot use UNION inside of ROM0 or ROMX sections error: union-in-rom.asm(3): Found ENDU outside of a UNION construct -error: Assembly aborted (2 errors)! +Assembly aborted with 2 errors! diff --git a/test/asm/unique-id.err b/test/asm/unique-id.err index d0f49d95..b66e0acf 100644 --- a/test/asm/unique-id.err +++ b/test/asm/unique-id.err @@ -29,4 +29,4 @@ error: unique-id.asm(15): while expanding symbol "warn_unique" warning: unique-id.asm(15): [-Wuser] ! -error: Assembly aborted (3 errors)! +Assembly aborted with 3 errors! diff --git a/test/asm/unterminated-rept.err b/test/asm/unterminated-rept.err index 1ab94d1a..b5718eac 100644 --- a/test/asm/unterminated-rept.err +++ b/test/asm/unterminated-rept.err @@ -1,3 +1,3 @@ error: unterminated-rept.asm(2): Unterminated REPT/FOR block -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/asm/use-label-outside-section.err b/test/asm/use-label-outside-section.err index 6f3c55f6..22f8e84c 100644 --- a/test/asm/use-label-outside-section.err +++ b/test/asm/use-label-outside-section.err @@ -2,4 +2,4 @@ error: use-label-outside-section.asm(1): Label "lab" created outside of a SECTION error: use-label-outside-section.asm(2): Expected constant expression: 'lab' is not constant at assembly time -error: Assembly aborted (2 errors)! +Assembly aborted with 2 errors! diff --git a/test/link/assert.out b/test/link/assert.out index 9530c917..e79f018b 100644 --- a/test/link/assert.out +++ b/test/link/assert.out @@ -1,4 +1,4 @@ warning: assert.asm(5): Worry about me, but not too much. error: assert.asm(6): Okay, this is getting serious! FATAL: assert.asm(7): It all ends now. -Linking aborted after 2 errors +Linking aborted with 2 errors diff --git a/test/link/cascading-errors-fatal-assert.out b/test/link/cascading-errors-fatal-assert.out index 9450aae3..1d7268d2 100644 --- a/test/link/cascading-errors-fatal-assert.out +++ b/test/link/cascading-errors-fatal-assert.out @@ -1,3 +1,3 @@ error: cascading-errors-fatal-assert.asm(1): Unknown symbol "UnknownSymbol" FATAL: cascading-errors-fatal-assert.asm(1): Failed to evaluate assertion -Linking aborted after 2 errors +Linking aborted with 2 errors diff --git a/test/link/romx-tiny-no-t.out b/test/link/romx-tiny-no-t.out index 6c007d90..c7454e73 100644 --- a/test/link/romx-tiny-no-t.out +++ b/test/link/romx-tiny-no-t.out @@ -1 +1,2 @@ -error: Unable to place "r0a" (ROM0 section) anywhere +FATAL: Unable to place "r0a" (ROM0 section) anywhere +Linking aborted with 1 error diff --git a/test/link/romx-tiny-t.out b/test/link/romx-tiny-t.out index 6c007d90..c7454e73 100644 --- a/test/link/romx-tiny-t.out +++ b/test/link/romx-tiny-t.out @@ -1 +1,2 @@ -error: Unable to place "r0a" (ROM0 section) anywhere +FATAL: Unable to place "r0a" (ROM0 section) anywhere +Linking aborted with 1 error diff --git a/test/link/section-union/assert.out b/test/link/section-union/assert.out index f79e64b4..fac55fe1 100644 --- a/test/link/section-union/assert.out +++ b/test/link/section-union/assert.out @@ -3,4 +3,4 @@ Linking failed with 1 error --- error: (30): Assertion failed: Force failing the build -error: Assembly aborted (1 error)! +Assembly aborted with 1 error! diff --git a/test/link/section-union/data-overlay.out b/test/link/section-union/data-overlay.out index 46ca4fd7..5e9d5b4f 100644 --- a/test/link/section-union/data-overlay.out +++ b/test/link/section-union/data-overlay.out @@ -1,4 +1,5 @@ -error: Section "overlaid data" is of type ROM0, which cannot be unionized +FATAL: Section "overlaid data" is of type ROM0, which cannot be unionized +Linking aborted with 1 error --- error: (18): Cannot declare ROM sections as UNION diff --git a/test/link/section-union/different-data.out b/test/link/section-union/different-data.out index f35f2598..4b234dc9 100644 --- a/test/link/section-union/different-data.out +++ b/test/link/section-union/different-data.out @@ -1,4 +1,5 @@ -error: Section "different data" is of type ROM0, which cannot be unionized +FATAL: Section "different data" is of type ROM0, which cannot be unionized +Linking aborted with 1 error --- error: (16): Cannot declare ROM sections as UNION diff --git a/test/link/section-union/different-size.out b/test/link/section-union/different-size.out index 00e604c7..c77d7492 100644 --- a/test/link/section-union/different-size.out +++ b/test/link/section-union/different-size.out @@ -1,4 +1,5 @@ -error: Section "different section sizes" is of type ROM0, which cannot be unionized +FATAL: Section "different section sizes" is of type ROM0, which cannot be unionized +Linking aborted with 1 error --- error: (16): Cannot declare ROM sections as UNION diff --git a/test/link/section-union/different-syntaxes.out b/test/link/section-union/different-syntaxes.out index 00ca4b47..bfee78e1 100644 --- a/test/link/section-union/different-syntaxes.out +++ b/test/link/section-union/different-syntaxes.out @@ -1,4 +1,5 @@ -error: Section "different syntaxes" is of type ROM0, which cannot be unionized +FATAL: Section "different syntaxes" is of type ROM0, which cannot be unionized +Linking aborted with 1 error --- error: (18): Cannot declare ROM sections as UNION diff --git a/test/link/section-union/no-room.out b/test/link/section-union/no-room.out index 31069afc..7f987ef3 100644 --- a/test/link/section-union/no-room.out +++ b/test/link/section-union/no-room.out @@ -1,2 +1,3 @@ -error: Unable to place "test" (WRAMX section) in bank $02 with align mask $ffc0 +FATAL: Unable to place "test" (WRAMX section) in bank $02 with align mask $ffc0 +Linking aborted with 1 error --- diff --git a/test/link/section-union/split-data.out b/test/link/section-union/split-data.out index ddceb8fd..b8adbd40 100644 --- a/test/link/section-union/split-data.out +++ b/test/link/section-union/split-data.out @@ -1,4 +1,5 @@ -error: Section "mutually-overlaid data" is of type ROM0, which cannot be unionized +FATAL: Section "mutually-overlaid data" is of type ROM0, which cannot be unionized +Linking aborted with 1 error --- error: (18): Cannot declare ROM sections as UNION diff --git a/test/link/vram-floating-dmg-mode-d.out b/test/link/vram-floating-dmg-mode-d.out index cbbbeb0a..bbbbf5ad 100644 --- a/test/link/vram-floating-dmg-mode-d.out +++ b/test/link/vram-floating-dmg-mode-d.out @@ -1 +1,2 @@ -error: Unable to place "v1" (VRAM section) anywhere +FATAL: Unable to place "v1" (VRAM section) anywhere +Linking aborted with 1 error diff --git a/test/link/wramx-dmg-mode-d.out b/test/link/wramx-dmg-mode-d.out index 4d2f7058..cb60cbda 100644 --- a/test/link/wramx-dmg-mode-d.out +++ b/test/link/wramx-dmg-mode-d.out @@ -1 +1,2 @@ -error: Unable to place "wx1" (WRAM0 section) anywhere +FATAL: Unable to place "wx1" (WRAM0 section) anywhere +Linking aborted with 1 error diff --git a/test/link/wramx-dmg-mode-no-d.out b/test/link/wramx-dmg-mode-no-d.out index 7ca08ed9..41e6ce53 100644 --- a/test/link/wramx-dmg-mode-no-d.out +++ b/test/link/wramx-dmg-mode-no-d.out @@ -1 +1,2 @@ -error: Unable to place "w0b" (WRAM0 section) anywhere +FATAL: Unable to place "w0b" (WRAM0 section) anywhere +Linking aborted with 1 error