Add -B/--backtrace option to RGBASM and RGBLINK (#1787)

This commit is contained in:
Rangi
2025-08-11 14:30:14 -04:00
committed by GitHub
parent 92a9c73ee7
commit 5f8b7474b4
303 changed files with 2729 additions and 2409 deletions

View File

@@ -83,6 +83,7 @@ src/asm/lexer.o src/asm/main.o: src/asm/parser.hpp
rgblink_obj := \
${common_obj} \
src/link/assign.o \
src/link/fstack.o \
src/link/lexer.o \
src/link/layout.o \
src/link/main.o \

View File

@@ -28,6 +28,7 @@ _rgbasm_completions() {
[V]="version:normal"
[W]="warning:warning"
[w]=":normal"
[B]="backtrace:unk"
[b]="binary-digits:unk"
[D]="define:unk"
[E]="export-all:normal"

View File

@@ -12,6 +12,7 @@ _rgblink_completions() {
[W]="warning:warning"
[M]="no-sym-in-map:normal"
[d]="dmg:normal"
[B]="backtrace:unk"
[l]="linkerscript:glob-*"
[m]="map:glob-*.map"
[n]="sym:glob-*.sym"

View File

@@ -42,6 +42,7 @@ local args=(
'(-v --verbose)'{-v,--verbose}'[Enable verbose output]'
-w'[Disable all warnings]'
'(-B --backtrace)'{-B,--backtrace}'+[Set backtrace depth or style]:depth:'
'(-b --binary-digits)'{-b,--binary-digits}'+[Change chars for binary constants]:digit spec:'
--color'[Whether to use color in output]:color:(auto always never)'
'*'{-D,--define}'+[Define a string symbol]:name + value (default 1):'

View File

@@ -28,6 +28,7 @@ local args=(
'(-w --wramx)'{-w,--wramx}'[Disable WRAM banking]'
'(-x --nopad)'{-x,--nopad}'[Disable padding the end of the final file]'
'(-B --backtrace)'{-B,--backtrace}'+[Set backtrace depth or style]:depth:'
--color'[Whether to use color in output]:color:(auto always never)'
'(-l --linkerscript)'{-l,--linkerscript}"+[Use a linker script]:linker script:_files -g '*.link'"
'(-M --no-sym-in-map)'{-M,--no-sym-in-map}'[Do not output symbol names in map file]'

View File

@@ -43,7 +43,8 @@ struct FileStackNode {
FileStackNode(FileStackNodeType type_, std::variant<std::vector<uint32_t>, std::string> data_)
: type(type_), data(data_) {}
std::string const &dump(uint32_t curLineNo) const;
void printBacktrace(uint32_t curLineNo) const;
std::vector<std::pair<std::string, uint32_t>> backtrace(uint32_t curLineNo) const;
std::string reptChain() const;
};
@@ -51,7 +52,7 @@ struct MacroArgs;
void fstk_VerboseOutputConfig();
bool fstk_DumpCurrent();
void fstk_TraceCurrent();
std::shared_ptr<FileStackNode> fstk_GetFileStack();
std::shared_ptr<std::string> fstk_GetUniqueIDStr();
MacroArgs *fstk_GetCurrentMacroArgs();

View File

@@ -133,7 +133,7 @@ void lexer_ReachELSEBlock();
void lexer_CheckRecursionDepth();
uint32_t lexer_GetLineNo();
void lexer_DumpStringExpansions();
void lexer_TraceStringExpansions();
struct Capture {
uint32_t lineNo;

View File

@@ -74,11 +74,10 @@ void fatal(char const *fmt, ...);
[[gnu::format(printf, 1, 2)]]
void error(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
// get a list of all errors at the end, making it easier to fix all of them at
// once.
void error(std::function<void()> callback);
// Used for errors that handle their own backtrace output. The code will fail
// to assemble but the user will get a list of all errors at the end, making it
// easier to fix all of them at once.
void errorNoTrace(std::function<void()> callback);
void requireZeroErrors();

View File

@@ -53,12 +53,15 @@ struct DiagnosticsState {
bool warningsAreErrors = false;
};
static constexpr uint64_t TRACE_COLLAPSE = UINT64_MAX;
template<typename L, typename W>
struct Diagnostics {
std::vector<WarningFlag<L>> metaWarnings;
std::vector<WarningFlag<L>> warningFlags;
std::vector<ParamWarning<W>> paramWarnings;
DiagnosticsState<W> state;
uint64_t traceDepth;
uint64_t nbErrors;
void incrementErrors() {

38
include/link/fstack.hpp Normal file
View File

@@ -0,0 +1,38 @@
// SPDX-License-Identifier: MIT
#ifndef RGBDS_LINK_FSTACK_HPP
#define RGBDS_LINK_FSTACK_HPP
#include <stdint.h>
#include <stdio.h>
#include <string>
#include <variant>
#include <vector>
#include "linkdefs.hpp"
struct FileStackNode {
FileStackNodeType type;
std::variant<
std::monostate, // Default constructed; `.type` and `.data` must be set manually
std::vector<uint32_t>, // NODE_REPT
std::string // NODE_FILE, NODE_MACRO
>
data;
FileStackNode *parent;
// Line at which the parent context was exited; meaningless for the root level
uint32_t lineNo;
// REPT iteration counts since last named node, in reverse depth order
std::vector<uint32_t> &iters() { return std::get<std::vector<uint32_t>>(data); }
std::vector<uint32_t> const &iters() const { return std::get<std::vector<uint32_t>>(data); }
// File name for files, file::macro name for macros
std::string &name() { return std::get<std::string>(data); }
std::string const &name() const { return std::get<std::string>(data); }
void printBacktrace(uint32_t curLineNo) const;
std::vector<std::pair<std::string, uint32_t>> backtrace(uint32_t curLineNo) const;
};
#endif // RGBDS_LINK_FSTACK_HPP

View File

@@ -4,13 +4,6 @@
#define RGBDS_LINK_MAIN_HPP
#include <stdint.h>
#include <stdio.h>
#include <string>
#include <variant>
#include <vector>
#include "linkdefs.hpp"
#include "verbosity.hpp"
struct Options {
bool isDmgMode; // -d
@@ -32,27 +25,4 @@ struct Options {
extern Options options;
struct FileStackNode {
FileStackNodeType type;
std::variant<
std::monostate, // Default constructed; `.type` and `.data` must be set manually
std::vector<uint32_t>, // NODE_REPT
std::string // NODE_FILE, NODE_MACRO
>
data;
FileStackNode *parent;
// Line at which the parent context was exited; meaningless for the root level
uint32_t lineNo;
// REPT iteration counts since last named node, in reverse depth order
std::vector<uint32_t> &iters() { return std::get<std::vector<uint32_t>>(data); }
std::vector<uint32_t> const &iters() const { return std::get<std::vector<uint32_t>>(data); }
// File name for files, file::macro name for macros
std::string &name() { return std::get<std::string>(data); }
std::string const &name() const { return std::get<std::string>(data); }
std::string const &dump(uint32_t curLineNo) const;
};
#endif // RGBDS_LINK_MAIN_HPP

View File

@@ -44,6 +44,6 @@ void sym_AddSymbol(Symbol &symbol);
// Finds a symbol in all the defined symbols.
Symbol *sym_GetSymbol(std::string const &name);
void sym_DumpLocalAliasedSymbols(std::string const &name);
void sym_TraceLocalAliasedSymbols(std::string const &name);
#endif // RGBDS_LINK_SYMBOL_HPP

View File

@@ -8,9 +8,12 @@
#include "diagnostics.hpp"
#define warningAt(where, ...) warning(where.src, where.lineNo, __VA_ARGS__)
#define errorAt(where, ...) error(where.src, where.lineNo, __VA_ARGS__)
#define fatalAt(where, ...) fatal(where.src, where.lineNo, __VA_ARGS__)
#define warningAt(where, ...) warning((where).src, (where).lineNo, __VA_ARGS__)
#define errorAt(where, ...) error((where).src, (where).lineNo, __VA_ARGS__)
#define fatalAt(where, ...) fatal((where).src, (where).lineNo, __VA_ARGS__)
#define fatalTwoAt(where1, where2, ...) \
fatalTwo(*(where1).src, (where1).lineNo, *(where2).src, (where2).lineNo, __VA_ARGS__)
enum WarningLevel {
LEVEL_DEFAULT, // Warnings that are enabled by default
@@ -46,8 +49,6 @@ void warning(char const *fmt, ...);
void error(FileStackNode const *src, 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, ...);
void scriptError(char const *name, uint32_t lineNo, char const *fmt, va_list args);
@@ -56,6 +57,16 @@ void fatal(FileStackNode const *src, uint32_t lineNo, char const *fmt, ...);
[[gnu::format(printf, 1, 2), noreturn]]
void fatal(char const *fmt, ...);
[[gnu::format(printf, 5, 6), noreturn]]
void fatalTwo(
FileStackNode const &src1,
uint32_t lineNo1,
FileStackNode const &src2,
uint32_t lineNo2,
char const *fmt,
...
);
void requireZeroErrors();
#endif // RGBDS_LINK_WARNING_HPP

View File

@@ -9,6 +9,7 @@
.Sh SYNOPSIS
.Nm
.Op Fl EhVvw
.Op Fl B Ar depth
.Op Fl b Ar chars
.Op Fl \-color Ar when
.Op Fl D Ar name Ns Op = Ns Ar value
@@ -52,6 +53,15 @@ is invalid because it could also be
.Fl \-version .
The arguments are as follows:
.Bl -tag -width Ds
.It Fl B Ar depth , Fl \-backtrace Ar depth
Specifies the maximum depth for which
.Nm
will print location backtraces for warnings or errors.
Deeper backtraces than that will be abbreviated.
.Fl B Ar 0
allows unlimited-depth backtraces.
.Fl B Ar collapse
will print the entire location trace on one line.
.It Fl b Ar chars , Fl \-binary-digits Ar chars
Allow two characters to be used for binary constants in addition to the default
.Sq 0

View File

@@ -9,6 +9,7 @@
.Sh SYNOPSIS
.Nm
.Op Fl dhMtVvwx
.Op Fl B Ar depth
.Op Fl \-color Ar when
.Op Fl l Ar linker_script
.Op Fl m Ar map_file
@@ -64,6 +65,15 @@ is invalid because it could also be
.Fl \-version .
The arguments are as follows:
.Bl -tag -width Ds
.It Fl B Ar depth , Fl \-backtrace Ar depth
Specifies the maximum depth for which
.Nm
will print location backtraces for warnings or errors.
Deeper backtraces than that will be abbreviated.
.Fl B Ar 0
allows unlimited-depth backtraces.
.Fl B Ar collapse
will print the entire location trace on one line.
.It Fl \-color Ar when
Specify when to highlight warning and error messages with color:
.Ql always ,

View File

@@ -60,6 +60,7 @@ set(rgbasm_src
set(rgblink_src
"${BISON_LINKER_SCRIPT_PARSER_OUTPUT_SOURCE}"
"link/assign.cpp"
"link/fstack.cpp"
"link/lexer.cpp"
"link/layout.cpp"
"link/main.cpp"

View File

@@ -60,42 +60,79 @@ std::string FileStackNode::reptChain() const {
return chain;
}
std::string const &FileStackNode::dump(uint32_t curLineNo) const {
std::vector<std::pair<std::string, uint32_t>> FileStackNode::backtrace(uint32_t curLineNo) const {
if (std::holds_alternative<std::vector<uint32_t>>(data)) {
assume(parent); // REPT nodes use their parent's name
std::string const &lastName = parent->dump(lineNo);
style_Set(stderr, STYLE_CYAN, false);
fputs(" -> ", stderr);
style_Set(stderr, STYLE_CYAN, true);
fputs(lastName.c_str(), stderr);
fputs(reptChain().c_str(), stderr);
style_Set(stderr, STYLE_CYAN, false);
fprintf(stderr, "(%" PRIu32 ")", curLineNo);
style_Reset(stderr);
return lastName;
std::vector<std::pair<std::string, uint32_t>> nodes = parent->backtrace(lineNo);
assume(!nodes.empty());
nodes.emplace_back(nodes.back().first + reptChain(), curLineNo);
return nodes;
} else if (parent) {
std::vector<std::pair<std::string, uint32_t>> nodes = parent->backtrace(lineNo);
nodes.emplace_back(name(), curLineNo);
return nodes;
} else {
if (parent) {
parent->dump(lineNo);
style_Set(stderr, STYLE_CYAN, false);
fputs(" -> ", stderr);
}
std::string const &nodeName = name();
style_Set(stderr, STYLE_CYAN, true);
fputs(nodeName.c_str(), stderr);
style_Set(stderr, STYLE_CYAN, false);
fprintf(stderr, "(%" PRIu32 ")", curLineNo);
style_Reset(stderr);
return nodeName;
return {
{name(), curLineNo}
};
}
}
bool fstk_DumpCurrent() {
if (lexer_AtTopLevel()) {
return false;
static void printNode(std::pair<std::string, uint32_t> const &node) {
style_Set(stderr, STYLE_CYAN, true);
fputs(node.first.c_str(), stderr);
style_Set(stderr, STYLE_CYAN, false);
fprintf(stderr, "(%" PRIu32 ")", node.second);
}
void FileStackNode::printBacktrace(uint32_t curLineNo) const {
std::vector<std::pair<std::string, uint32_t>> nodes = backtrace(curLineNo);
size_t n = nodes.size();
if (warnings.traceDepth == TRACE_COLLAPSE) {
fputs(" ", stderr); // Just three spaces; the fourth will be handled by the loop
for (size_t i = 0; i < n; ++i) {
style_Reset(stderr);
fprintf(stderr, " %s ", i == 0 ? "at" : "<-");
printNode(nodes[n - i - 1]);
}
putc('\n', stderr);
} else if (warnings.traceDepth == 0 || static_cast<size_t>(warnings.traceDepth) >= n) {
for (size_t i = 0; i < n; ++i) {
style_Reset(stderr);
fprintf(stderr, " %s ", i == 0 ? "at" : "<-");
printNode(nodes[n - i - 1]);
putc('\n', stderr);
}
} else {
size_t last = warnings.traceDepth / 2;
size_t first = warnings.traceDepth - last;
size_t skipped = n - warnings.traceDepth;
for (size_t i = 0; i < first; ++i) {
style_Reset(stderr);
fprintf(stderr, " %s ", i == 0 ? "at" : "<-");
printNode(nodes[n - i - 1]);
putc('\n', stderr);
}
style_Reset(stderr);
fprintf(stderr, " ...%zu more%s\n", skipped, last ? "..." : "");
for (size_t i = n - last; i < n; ++i) {
style_Reset(stderr);
fputs(" <- ", stderr);
printNode(nodes[n - i - 1]);
putc('\n', stderr);
}
}
assume(!contextStack.empty());
contextStack.top().fileInfo->dump(lexer_GetLineNo());
return true;
style_Reset(stderr);
}
void fstk_TraceCurrent() {
if (!lexer_AtTopLevel()) {
assume(!contextStack.empty());
contextStack.top().fileInfo->printBacktrace(lexer_GetLineNo());
}
lexer_TraceStringExpansions();
}
// LCOV_EXCL_START

View File

@@ -838,16 +838,16 @@ uint32_t lexer_GetLineNo() {
return lexerState->lineNo;
}
void lexer_DumpStringExpansions() {
void lexer_TraceStringExpansions() {
if (!lexerState) {
return;
}
for (Expansion &exp : lexerState->expansions) {
// Only register EQUS expansions, not string args
// Only print EQUS expansions, not string args
if (exp.name) {
style_Set(stderr, STYLE_CYAN, false);
fputs("while expanding symbol \"", stderr);
fputs(" while expanding symbol \"", stderr);
style_Set(stderr, STYLE_CYAN, true);
fputs(exp.name->c_str(), stderr);
style_Set(stderr, STYLE_CYAN, false);

View File

@@ -34,7 +34,7 @@ static char const *dependFileName = nullptr;
static std::unordered_map<std::string, std::vector<StateFeature>> stateFileSpecs; // -s
// Short options
static char const *optstring = "b:D:Eg:hI:M:o:P:p:Q:r:s:VvW:wX:";
static char const *optstring = "B:b:D:Eg:hI:M:o:P:p:Q:r:s:VvW:wX:";
// Variables for the long-only options
static int longOpt; // `--color` and variants of `-M`
@@ -47,6 +47,7 @@ static int longOpt; // `--color` and variants of `-M`
// This is because long opt matching, even to a single char, is prioritized
// over short opt matching.
static option const longopts[] = {
{"backtrace", required_argument, nullptr, 'B'},
{"binary-digits", required_argument, nullptr, 'b'},
{"define", required_argument, nullptr, 'D'},
{"export-all", no_argument, nullptr, 'E'},
@@ -77,7 +78,7 @@ static option const longopts[] = {
static Usage usage = {
.name = "rgbasm",
.flags = {
"[-EhVvw]", "[-b chars]", "[-D name[=value]]", "[-g chars]", "[-I path]",
"[-EhVvw]", "[-B depth]", "[-b chars]", "[-D name[=value]]", "[-g chars]", "[-I path]",
"[-M depend_file]", "[-MC]", "[-MG]", "[-MP]", "[-MT target_file]", "[-MQ target_file]",
"[-o out_file]", "[-P include_file]", "[-p pad_value]", "[-Q precision]", "[-r depth]",
"[-s features:state_file]", "[-W warning]", "[-X max_errors]", "<file>",
@@ -215,7 +216,6 @@ static void verboseOutputConfig(int argc, char *argv[]) {
if (options.generatePhonyDeps) {
fputs("\tGenerate phony dependencies\n", stderr);
}
// [-MG] [-MC]
}
fputs("Ready.\n", stderr);
@@ -303,6 +303,24 @@ int main(int argc, char *argv[]) {
switch (ch) {
char *endptr;
case 'B': {
if (!strcasecmp(musl_optarg, "collapse")) {
warnings.traceDepth = TRACE_COLLAPSE;
break;
}
warnings.traceDepth = strtoul(musl_optarg, &endptr, 0);
if (musl_optarg[0] == '\0' || *endptr != '\0') {
fatal("Invalid argument for option 'B'");
}
if (warnings.traceDepth >= UINT64_MAX) {
fatal("Argument for option 'B' is too large");
}
break;
}
case 'b':
if (strlen(musl_optarg) == 2) {
opt_B(musl_optarg);

View File

@@ -281,9 +281,12 @@ static void mergeSections(
break;
case SECTION_NORMAL:
sectError([&]() {
fputs("Section already defined previously at ", stderr);
sect.src->dump(sect.fileLine);
errorNoTrace([&]() {
fputs("Section already defined\n", stderr);
fstk_TraceCurrent();
fputs(" and also:\n", stderr);
sect.src->printBacktrace(sect.fileLine);
++nbSectErrors;
});
break;
}

View File

@@ -113,14 +113,15 @@ std::shared_ptr<std::string> Symbol::getEqus() const {
return std::get<std::shared_ptr<std::string>>(data);
}
static void dumpFilename(Symbol const &sym) {
fputs(" at ", stderr);
// Meant to be called last in an `errorNoTrace` callback
static void printBacktraces(Symbol const &sym) {
putc('\n', stderr);
fstk_TraceCurrent();
fputs(" and also:\n", stderr);
if (sym.src) {
sym.src->dump(sym.fileLine);
} else if (sym.isBuiltin) {
fputs("<builtin>", stderr);
sym.src->printBacktrace(sym.fileLine);
} else {
fputs("<command-line>", stderr);
fprintf(stderr, " at <%s>\n", sym.isBuiltin ? "builtin" : "command-line");
}
}
@@ -141,37 +142,52 @@ static bool isValidIdentifier(std::string const &s) {
}
static void alreadyDefinedError(Symbol const &sym, char const *asType) {
if (sym.isBuiltin && !sym_FindScopedValidSymbol(sym.name)) {
// `DEF()` would return false, so we should not claim the symbol is already defined
error("'%s' is reserved for a built-in symbol", sym.name.c_str());
auto suggestion = [&]() {
std::string s;
if (auto const &contents = sym.type == SYM_EQUS ? sym.getEqus() : nullptr;
contents && isValidIdentifier(*contents)) {
s.append(" (should it be {interpolated} to define its contents \"");
s.append(*contents);
s.append("\"?)");
}
return s;
};
if (sym.isBuiltin) {
if (sym_FindScopedValidSymbol(sym.name)) {
if (std::string s = suggestion(); asType) {
error("'%s' already defined as built-in %s%s", sym.name.c_str(), asType, s.c_str());
} else {
error("'%s' already defined as built-in%s", sym.name.c_str(), s.c_str());
}
} else {
// `DEF()` would return false, so we should not claim the symbol is already defined,
// nor suggest to interpolate it
if (asType) {
error("'%s' is reserved for a built-in %s symbol", sym.name.c_str(), asType);
} else {
error("'%s' is reserved for a built-in symbol", sym.name.c_str());
}
}
} else {
error([&]() {
errorNoTrace([&]() {
fprintf(stderr, "'%s' already defined", sym.name.c_str());
if (asType) {
fprintf(stderr, " as %s", asType);
}
dumpFilename(sym);
if (sym.type != SYM_EQUS) {
return;
}
if (std::string const &contents = *sym.getEqus(); isValidIdentifier(contents)) {
fprintf(
stderr,
"\n (should it be {interpolated} to define its contents \"%s\"?)",
contents.c_str()
);
}
fputs(suggestion().c_str(), stderr);
printBacktraces(sym);
});
}
}
static void redefinedError(Symbol const &sym) {
assume(sym.isBuiltin);
if (!sym_FindScopedValidSymbol(sym.name)) {
if (sym_FindScopedValidSymbol(sym.name)) {
error("Built-in symbol '%s' cannot be redefined", sym.name.c_str());
} else {
// `DEF()` would return false, so we should not imply the symbol is already defined
error("'%s' is reserved for a built-in symbol", sym.name.c_str());
} else {
error("Built-in symbol '%s' cannot be redefined", sym.name.c_str());
}
}
@@ -376,9 +392,9 @@ static Symbol *createNonrelocSymbol(std::string const &symName, bool numeric) {
return nullptr; // Don't allow overriding the symbol, that'd be bad!
} else if (!numeric) {
// The symbol has already been referenced, but it's not allowed
error([&]() {
errorNoTrace([&]() {
fprintf(stderr, "'%s' already referenced", symName.c_str());
dumpFilename(*sym);
printBacktraces(*sym);
});
return nullptr; // Don't allow overriding the symbol, that'd be bad!
}
@@ -444,9 +460,9 @@ Symbol *sym_RedefString(std::string const &symName, std::shared_ptr<std::string>
if (sym->isDefined()) {
alreadyDefinedError(*sym, "non-EQUS");
} else {
error([&]() {
errorNoTrace([&]() {
fprintf(stderr, "'%s' already referenced", symName.c_str());
dumpFilename(*sym);
printBacktraces(*sym);
});
}
return nullptr;

View File

@@ -60,6 +60,7 @@ Diagnostics<WarningLevel, WarningID> warnings = {
{WARNING_UNMAPPED_CHAR_1, WARNING_UNMAPPED_CHAR_2, 1},
},
.state = DiagnosticsState<WarningID>(),
.traceDepth = 0,
.nbErrors = 0,
};
// clang-format on
@@ -74,19 +75,16 @@ static void printDiag(
) {
style_Set(stderr, color, true);
fprintf(stderr, "%s: ", type);
if (fstk_DumpCurrent()) {
putc(':', stderr);
if (flagfmt) {
style_Set(stderr, color, true);
fprintf(stderr, flagfmt, flag);
}
fputs("\n ", stderr);
}
style_Reset(stderr);
vfprintf(stderr, fmt, args);
if (flagfmt) {
style_Set(stderr, color, true);
putc(' ', stderr);
fprintf(stderr, flagfmt, flag);
}
putc('\n', stderr);
lexer_DumpStringExpansions();
fstk_TraceCurrent();
}
static void incrementErrors() {
@@ -117,16 +115,11 @@ void error(char const *fmt, ...) {
incrementErrors();
}
void error(std::function<void()> callback) {
void errorNoTrace(std::function<void()> callback) {
style_Set(stderr, STYLE_RED, true);
fputs("error: ", stderr);
if (fstk_DumpCurrent()) {
fputs(":\n ", stderr);
}
style_Reset(stderr);
callback();
putc('\n', stderr);
lexer_DumpStringExpansions();
incrementErrors();
}
@@ -167,11 +160,11 @@ void warning(WarningID id, char const *fmt, ...) {
break;
case WarningBehavior::ENABLED:
printDiag(fmt, args, "warning", STYLE_YELLOW, " [-W%s]", flag);
printDiag(fmt, args, "warning", STYLE_YELLOW, "[-W%s]", flag);
break;
case WarningBehavior::ERROR:
printDiag(fmt, args, "error", STYLE_RED, " [-Werror=%s]", flag);
printDiag(fmt, args, "error", STYLE_RED, "[-Werror=%s]", flag);
break;
}

View File

@@ -19,6 +19,7 @@ Diagnostics<WarningLevel, WarningID> warnings = {
},
.paramWarnings = {},
.state = DiagnosticsState<WarningID>(),
.traceDepth = 0,
.nbErrors = 0,
};
// clang-format on

View File

@@ -22,6 +22,7 @@ Diagnostics<WarningLevel, WarningID> warnings = {
},
.paramWarnings = {},
.state = DiagnosticsState<WarningID>(),
.traceDepth = 0,
.nbErrors = 0,
};
// clang-format on

80
src/link/fstack.cpp Normal file
View File

@@ -0,0 +1,80 @@
#include "link/fstack.hpp"
#include <inttypes.h>
#include <utility>
#include "style.hpp"
#include "link/warning.hpp"
std::vector<std::pair<std::string, uint32_t>> FileStackNode::backtrace(uint32_t curLineNo) const {
if (std::holds_alternative<std::vector<uint32_t>>(data)) {
assume(parent); // REPT nodes use their parent's name
std::vector<std::pair<std::string, uint32_t>> nodes = parent->backtrace(lineNo);
assume(!nodes.empty());
std::string reptChain = nodes.back().first;
for (uint32_t iter : iters()) {
reptChain.append("::REPT~");
reptChain.append(std::to_string(iter));
}
nodes.emplace_back(reptChain, curLineNo);
return nodes;
} else if (parent) {
std::vector<std::pair<std::string, uint32_t>> nodes = parent->backtrace(lineNo);
nodes.emplace_back(name(), curLineNo);
return nodes;
} else {
return {
{name(), curLineNo}
};
}
}
static void printNode(std::pair<std::string, uint32_t> const &node) {
style_Set(stderr, STYLE_CYAN, true);
fputs(node.first.c_str(), stderr);
style_Set(stderr, STYLE_CYAN, false);
fprintf(stderr, "(%" PRIu32 ")", node.second);
}
void FileStackNode::printBacktrace(uint32_t curLineNo) const {
std::vector<std::pair<std::string, uint32_t>> nodes = backtrace(curLineNo);
size_t n = nodes.size();
if (warnings.traceDepth == TRACE_COLLAPSE) {
fputs(" ", stderr); // Just three spaces; the fourth will be handled by the loop
for (size_t i = 0; i < n; ++i) {
style_Reset(stderr);
fprintf(stderr, " %s ", i == 0 ? "at" : "<-");
printNode(nodes[n - i - 1]);
}
putc('\n', stderr);
} else if (warnings.traceDepth == 0 || static_cast<size_t>(warnings.traceDepth) >= n) {
for (size_t i = 0; i < n; ++i) {
style_Reset(stderr);
fprintf(stderr, " %s ", i == 0 ? "at" : "<-");
printNode(nodes[n - i - 1]);
putc('\n', stderr);
}
} else {
size_t last = warnings.traceDepth / 2;
size_t first = warnings.traceDepth - last;
size_t skipped = n - warnings.traceDepth;
for (size_t i = 0; i < first; ++i) {
style_Reset(stderr);
fprintf(stderr, " %s ", i == 0 ? "at" : "<-");
printNode(nodes[n - i - 1]);
putc('\n', stderr);
}
style_Reset(stderr);
fprintf(stderr, " ...%zu more%s\n", skipped, last ? "..." : "");
for (size_t i = n - last; i < n; ++i) {
style_Reset(stderr);
fputs(" <- ", stderr);
printNode(nodes[n - i - 1]);
putc('\n', stderr);
}
}
style_Reset(stderr);
}

View File

@@ -36,7 +36,7 @@ Options options;
static char const *linkerScriptName = nullptr; // -l
// Short options
static char const *optstring = "dhl:m:Mn:O:o:p:S:tVvW:wx";
static char const *optstring = "B:dhl:m:Mn:O:o:p:S:tVvW:wx";
// Variables for the long-only options
static int longOpt; // `--color`
@@ -49,6 +49,7 @@ static int longOpt; // `--color`
// This is because long opt matching, even to a single char, is prioritized
// over short opt matching.
static option const longopts[] = {
{"backtrace", required_argument, nullptr, 'B'},
{"dmg", no_argument, nullptr, 'd'},
{"help", no_argument, nullptr, 'h'},
{"linkerscript", required_argument, nullptr, 'l'},
@@ -73,8 +74,8 @@ static option const longopts[] = {
static Usage usage = {
.name = "rgblink",
.flags = {
"[-dhMtVvwx]", "[-l script]", "[-m map_file]", "[-n sym_file]", "[-O overlay_file]",
"[-o out_file]", "[-p pad_value]", "[-S spec]", "<file> ...",
"[-dhMtVvwx]", "[-B depth]", "[-l script]", "[-m map_file]", "[-n sym_file]",
"[-O overlay_file]", "[-o out_file]", "[-p pad_value]", "[-S spec]", "<file> ...",
},
.options = {
{{"-l", "--linkerscript <path>"}, {"set the input linker script"}},
@@ -180,37 +181,6 @@ static void verboseOutputConfig(int argc, char *argv[]) {
}
// LCOV_EXCL_STOP
std::string const &FileStackNode::dump(uint32_t curLineNo) const {
if (std::holds_alternative<std::vector<uint32_t>>(data)) {
assume(parent); // REPT nodes use their parent's name
std::string const &lastName = parent->dump(lineNo);
style_Set(stderr, STYLE_CYAN, false);
fputs(" -> ", stderr);
style_Set(stderr, STYLE_CYAN, true);
fputs(lastName.c_str(), stderr);
for (uint32_t iter : iters()) {
fprintf(stderr, "::REPT~%" PRIu32, iter);
}
style_Set(stderr, STYLE_CYAN, false);
fprintf(stderr, "(%" PRIu32 ")", curLineNo);
style_Reset(stderr);
return lastName;
} else {
if (parent) {
parent->dump(lineNo);
style_Set(stderr, STYLE_CYAN, false);
fputs(" -> ", stderr);
}
std::string const &nodeName = name();
style_Set(stderr, STYLE_CYAN, true);
fputs(nodeName.c_str(), stderr);
style_Set(stderr, STYLE_CYAN, false);
fprintf(stderr, "(%" PRIu32 ")", curLineNo);
style_Reset(stderr);
return nodeName;
}
}
static void parseScrambleSpec(char *spec) {
// clang-format off: vertically align nested initializers
static UpperMap<std::pair<uint16_t *, uint16_t>> scrambleSpecs{
@@ -325,6 +295,21 @@ int main(int argc, char *argv[]) {
// Parse options
for (int ch; (ch = musl_getopt_long_only(argc, argv, optstring, longopts, nullptr)) != -1;) {
switch (ch) {
case 'B': {
if (!strcasecmp(musl_optarg, "collapse")) {
warnings.traceDepth = TRACE_COLLAPSE;
break;
}
char *endptr;
warnings.traceDepth = strtoul(musl_optarg, &endptr, 0);
if (musl_optarg[0] == '\0' || *endptr != '\0') {
fatal("Invalid argument for option 'B'");
}
if (warnings.traceDepth >= UINT64_MAX) {
fatal("Argument for option 'B' is too large");
}
break;
}
case 'd':
options.isDmgMode = true;
options.isWRAM0Mode = true;

View File

@@ -21,6 +21,7 @@
#include "version.hpp"
#include "link/assign.hpp"
#include "link/fstack.hpp"
#include "link/main.hpp"
#include "link/patch.hpp"
#include "link/sdas_obj.hpp"

View File

@@ -428,7 +428,7 @@ static int32_t computeRPNExpr(Patch const &patch, std::vector<Symbol> const &fil
}
} else if (Symbol const *symbol = getSymbol(fileSymbols, value); !symbol) {
errorAt(patch, "Undefined symbol \"%s\"", fileSymbols[value].name.c_str());
sym_DumpLocalAliasedSymbols(fileSymbols[value].name);
sym_TraceLocalAliasedSymbols(fileSymbols[value].name);
isError = true;
} else if (std::holds_alternative<Label>(symbol->data)) {
Label const &label = std::get<Label>(symbol->data);

View File

@@ -14,6 +14,7 @@
#include "platform.hpp"
#include "link/assign.hpp"
#include "link/fstack.hpp"
#include "link/main.hpp"
#include "link/section.hpp"
#include "link/symbol.hpp"
@@ -280,7 +281,7 @@ void sdobj_ReadFile(FileStackNode const &src, FILE *file, std::vector<Symbol> &f
// The following is required for fragment offsets to be reliably predicted
for (FileSection &entry : fileSections) {
if (!strcmp(token, entry.section->name.c_str())) {
fatalAt(where, "Area \"%s\" already defined earlier", token);
fatalAt(where, "Area \"%s\" already defined", token);
}
}
char const *sectName = token; // We'll deal with the section's name depending on type
@@ -422,14 +423,14 @@ void sdobj_ReadFile(FileStackNode const &src, FILE *file, std::vector<Symbol> &f
|| (symbolSection && !symbolSection->isAddressFixed)) {
sym_AddSymbol(symbol); // This will error out
} else if (otherValue != symbolValue) {
errorNoDump(
"\"%s\" is defined as %" PRId32 " at ", symbol.name.c_str(), symbolValue
fatalTwoAt(
symbol,
*other,
"\"%s\" is defined as %" PRId32 ", but was already defined as %" PRId32,
symbol.name.c_str(),
symbolValue,
otherValue
);
symbol.src->dump(symbol.lineNo);
fprintf(stderr, ", but as %" PRId32 " at ", otherValue);
other->src->dump(other->lineNo);
putc('\n', stderr);
exit(1);
}
} else {
// Add a new definition

View File

@@ -24,30 +24,28 @@ void sect_ForEach(void (*callback)(Section &)) {
static void checkAgainstFixedAddress(Section const &target, Section const &other, uint16_t org) {
if (target.isAddressFixed) {
if (target.org != org) {
errorNoDump(
"Section \"%s\" is defined with address $%04" PRIx16 " at ",
fatalTwoAt(
target,
other,
"Section \"%s\" is defined with address $%04" PRIx16
", but also with address $%04" PRIx16,
target.name.c_str(),
target.org
target.org,
other.org
);
target.src->dump(target.lineNo);
fprintf(stderr, ", but with address $%04" PRIx16 " at ", other.org);
other.src->dump(other.lineNo);
putc('\n', stderr);
exit(1);
}
} else if (target.isAlignFixed) {
if ((org - target.alignOfs) & target.alignMask) {
errorNoDump(
"Section \"%s\" is defined with %d-byte alignment (offset %" PRIu16 ") at ",
fatalTwoAt(
target,
other,
"Section \"%s\" is defined with %d-byte alignment (offset %" PRIu16
"), but also with address $%04" PRIx16,
target.name.c_str(),
target.alignMask + 1,
target.alignOfs
target.alignOfs,
other.org
);
target.src->dump(target.lineNo);
fprintf(stderr, ", but with address $%04" PRIx16 " at ", other.org);
other.src->dump(other.lineNo);
putc('\n', stderr);
exit(1);
}
}
}
@@ -55,41 +53,31 @@ static void checkAgainstFixedAddress(Section const &target, Section const &other
static bool checkAgainstFixedAlign(Section const &target, Section const &other, int32_t ofs) {
if (target.isAddressFixed) {
if ((target.org - ofs) & other.alignMask) {
errorNoDump(
"Section \"%s\" is defined with address $%04" PRIx16 " at ",
fatalTwoAt(
target,
other,
"Section \"%s\" is defined with address $%04" PRIx16
", but also with %d-byte alignment (offset %" PRIu16 ")",
target.name.c_str(),
target.org
);
target.src->dump(target.lineNo);
fprintf(
stderr,
", but with %d-byte alignment (offset %" PRIu16 ") at ",
target.org,
other.alignMask + 1,
other.alignOfs
);
other.src->dump(other.lineNo);
putc('\n', stderr);
exit(1);
}
return false;
} else if (target.isAlignFixed
&& (other.alignMask & target.alignOfs) != (target.alignMask & ofs)) {
errorNoDump(
"Section \"%s\" is defined with %d-byte alignment (offset %" PRIu16 ") at ",
fatalTwoAt(
target,
other,
"Section \"%s\" is defined with %d-byte alignment (offset %" PRIu16
"), but also with %d-byte alignment (offset %" PRIu16 ")",
target.name.c_str(),
target.alignMask + 1,
target.alignOfs
);
target.src->dump(target.lineNo);
fprintf(
stderr,
", but with %d-byte alignment (offset %" PRIu16 ") at ",
target.alignOfs,
other.alignMask + 1,
other.alignOfs
);
other.src->dump(other.lineNo);
putc('\n', stderr);
exit(1);
} else {
return !target.isAlignFixed || (other.alignMask > target.alignMask);
}
@@ -129,34 +117,25 @@ static void checkFragmentCompat(Section &target, Section &other) {
static void mergeSections(Section &target, std::unique_ptr<Section> &&other) {
if (target.modifier != other->modifier) {
errorNoDump(
"Section \"%s\" is defined as SECTION %s at ",
fatalTwoAt(
target,
*other,
"Section \"%s\" is defined as SECTION %s, but also as SECTION %s",
target.name.c_str(),
sectionModNames[target.modifier]
sectionModNames[target.modifier],
sectionModNames[other->modifier]
);
target.src->dump(target.lineNo);
fprintf(stderr, ", but as SECTION %s at ", sectionModNames[other->modifier]);
other->src->dump(other->lineNo);
putc('\n', stderr);
exit(1);
} else if (other->modifier == SECTION_NORMAL) {
errorNoDump("Section \"%s\" is defined at ", target.name.c_str());
target.src->dump(target.lineNo);
fputs(", but also at ", stderr);
other->src->dump(other->lineNo);
putc('\n', stderr);
exit(1);
fatalTwoAt(target, *other, "Section \"%s\" is already defined", target.name.c_str());
} else if (target.type != other->type) {
errorNoDump(
"Section \"%s\" is defined with type %s at ",
fatalTwoAt(
target,
*other,
"Section \"%s\" is defined with type %s, but also with type %s",
target.name.c_str(),
sectionTypeInfo[target.type].name.c_str()
sectionTypeInfo[target.type].name.c_str(),
sectionTypeInfo[other->type].name.c_str()
);
target.src->dump(target.lineNo);
fprintf(stderr, ", but with type %s at ", sectionTypeInfo[other->type].name.c_str());
other->src->dump(other->lineNo);
putc('\n', stderr);
exit(1);
}
if (other->isBankFixed) {
@@ -164,16 +143,14 @@ static void mergeSections(Section &target, std::unique_ptr<Section> &&other) {
target.isBankFixed = true;
target.bank = other->bank;
} else if (target.bank != other->bank) {
errorNoDump(
"Section \"%s\" is defined with bank %" PRIu32 " at ",
fatalTwoAt(
target,
*other,
"Section \"%s\" is defined with bank %" PRIu32 ", but also with bank %" PRIu32,
target.name.c_str(),
target.bank
target.bank,
other->bank
);
target.src->dump(target.lineNo);
fprintf(stderr, ", but with bank %" PRIu32 " at ", other->bank);
other->src->dump(other->lineNo);
putc('\n', stderr);
exit(1);
}
}

View File

@@ -9,7 +9,7 @@
#include "helpers.hpp" // assume
#include "link/main.hpp"
#include "link/fstack.hpp"
#include "link/section.hpp"
#include "link/warning.hpp"
@@ -39,24 +39,16 @@ void sym_AddSymbol(Symbol &symbol) {
// Check if the symbol already exists with a different value
if (other && !(symValue && otherValue && *symValue == *otherValue)) {
errorNoDump("\"%s\" is defined as ", symbol.name.c_str());
if (symValue) {
fprintf(stderr, "%" PRId32, *symValue);
} else {
fputs("a label", stderr);
}
fputs(" at ", stderr);
symbol.src->dump(symbol.lineNo);
fputs(", but as ", stderr);
if (otherValue) {
fprintf(stderr, "%" PRId32, *otherValue);
} else {
fputs("another label", stderr);
}
fputs(" at ", stderr);
other->src->dump(other->lineNo);
putc('\n', stderr);
exit(1);
std::string symDef = symValue ? std::to_string(*symValue) : "a label";
std::string otherDef = otherValue ? std::to_string(*otherValue) : "another label";
fatalTwoAt(
symbol,
*other,
"\"%s\" is defined as %s, but also as %s",
symbol.name.c_str(),
symDef.c_str(),
otherDef.c_str()
);
}
// If not, add it (potentially replacing the previous same-value symbol)
@@ -68,29 +60,28 @@ Symbol *sym_GetSymbol(std::string const &name) {
return search != symbols.end() ? search->second : nullptr;
}
void sym_DumpLocalAliasedSymbols(std::string const &name) {
void sym_TraceLocalAliasedSymbols(std::string const &name) {
std::vector<Symbol *> const &locals = localSymbols[name];
if (locals.empty()) {
return;
}
bool plural = locals.size() != 1;
fprintf(
stderr,
" %zu symbol%s with that name %s defined but not exported:\n",
locals.size(),
plural ? "s" : "",
plural ? "are" : "is"
);
int count = 0;
for (Symbol *local : locals) {
if (count++ == 3) {
size_t remaining = locals.size() - 3;
bool plural = remaining != 1;
fprintf(
stderr,
" ...and %zu more symbol%s with that name %s defined but not exported\n",
remaining,
plural ? "s" : "",
plural ? "are" : "is"
);
assume(local->src);
local->src->printBacktrace(local->lineNo);
if (++count == 3 && locals.size() > 3) {
fprintf(stderr, " ...and %zu more\n", locals.size() - 3);
break;
}
fprintf(
stderr,
" A %s with that name is defined but not exported at ",
std::holds_alternative<Label>(local->data) ? "label" : "constant"
);
assume(local->src);
local->src->dump(local->lineNo);
putc('\n', stderr);
}
}

View File

@@ -7,7 +7,7 @@
#include "style.hpp"
#include "link/main.hpp"
#include "link/fstack.hpp"
// clang-format off: nested initializers
Diagnostics<WarningLevel, WarningID> warnings = {
@@ -25,6 +25,7 @@ Diagnostics<WarningLevel, WarningID> warnings = {
},
.paramWarnings = {},
.state = DiagnosticsState<WarningID>(),
.traceDepth = 0,
.nbErrors = 0,
};
// clang-format on
@@ -41,18 +42,18 @@ static void printDiag(
) {
style_Set(stderr, color, true);
fprintf(stderr, "%s: ", type);
if (src) {
src->dump(lineNo);
fputs(": ", stderr);
}
if (flagfmt) {
style_Set(stderr, color, true);
fprintf(stderr, flagfmt, flag);
fputs("\n ", stderr);
}
style_Reset(stderr);
vfprintf(stderr, fmt, args);
if (flagfmt) {
style_Set(stderr, color, true);
putc(' ', stderr);
fprintf(stderr, flagfmt, flag);
}
putc('\n', stderr);
if (src) {
src->printBacktrace(lineNo);
}
}
[[noreturn]]
@@ -101,26 +102,15 @@ void error(char const *fmt, ...) {
warnings.incrementErrors();
}
void errorNoDump(char const *fmt, ...) {
va_list args;
style_Set(stderr, STYLE_RED, true);
fputs("error: ", stderr);
style_Reset(stderr);
va_start(args, fmt);
vfprintf(stderr, fmt, args);
va_end(args);
warnings.incrementErrors();
}
void scriptError(char const *name, uint32_t lineNo, char const *fmt, va_list args) {
style_Set(stderr, STYLE_RED, true);
fputs("error: ", stderr);
style_Set(stderr, STYLE_CYAN, true);
fputs(name, stderr);
style_Set(stderr, STYLE_CYAN, false);
fprintf(stderr, "(%" PRIu32 "): ", lineNo);
fprintf(stderr, "(%" PRIu32 ")", lineNo);
style_Reset(stderr);
fputs(": ", stderr);
vfprintf(stderr, fmt, args);
putc('\n', stderr);
@@ -149,6 +139,32 @@ void fatal(char const *fmt, ...) {
abortLinking(nullptr);
}
[[noreturn]]
void fatalTwo(
FileStackNode const &src1,
uint32_t lineNo1,
FileStackNode const &src2,
uint32_t lineNo2,
char const *fmt,
...
) {
va_list args;
style_Set(stderr, STYLE_RED, true);
fputs("FATAL: ", stderr);
style_Reset(stderr);
va_start(args, fmt);
vfprintf(stderr, fmt, args);
va_end(args);
putc('\n', stderr);
src1.printBacktrace(lineNo1);
fputs(" and also:\n", stderr);
src2.printBacktrace(lineNo2);
warnings.incrementErrors();
abortLinking(nullptr);
}
void requireZeroErrors() {
if (warnings.nbErrors != 0) {
abortLinking("failed");

View File

@@ -1,3 +1,3 @@
error: align-large-ofs.asm(2):
The absolute alignment offset (2) must be less than alignment size (2)
error: The absolute alignment offset (2) must be less than alignment size (2)
at align-large-ofs.asm(2)
Assembly aborted with 1 error!

View File

@@ -1,5 +1,5 @@
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: Alignment must be between 0 and 16, not 17
at align-large.asm(1)
error: Alignment must be between 0 and 16, not 17
at align-large.asm(2)
Assembly aborted with 2 errors!

View File

@@ -1,5 +1,5 @@
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: The absolute alignment offset (18) must be less than alignment size (16)
at align-offset.asm(4)
error: The absolute alignment offset (20) must be less than alignment size (16)
at align-offset.asm(6)
Assembly aborted with 2 errors!

View File

@@ -1,3 +1,3 @@
error: align-pc-outside-section.asm(1):
Cannot output data outside of a SECTION
error: Cannot output data outside of a SECTION
at align-pc-outside-section.asm(1)
Assembly aborted with 1 error!

View File

@@ -1,3 +1,3 @@
error: align-unattainable.asm(3):
Section "X"'s alignment cannot be attained in WRAM0
error: Section "X"'s alignment cannot be attained in WRAM0
at align-unattainable.asm(3)
Assembly aborted with 1 error!

View File

@@ -1,11 +1,11 @@
error: anon-label-bad.asm(2):
Label "!0" created outside of a SECTION
error: anon-label-bad.asm(6):
Reference to anonymous label 2 before, when only 1 has been created so far
error: anon-label-bad.asm(9):
syntax error, unexpected anonymous label
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: Label "!0" created outside of a SECTION
at anon-label-bad.asm(2)
error: Reference to anonymous label 2 before, when only 1 has been created so far
at anon-label-bad.asm(6)
error: syntax error, unexpected anonymous label
at anon-label-bad.asm(9)
error: syntax error, unexpected anonymous label, expecting symbol or label or local label
at anon-label-bad.asm(10)
error: syntax error, unexpected ::
at anon-label-bad.asm(22)
Assembly aborted with 5 errors!

View File

@@ -1,2 +1,2 @@
FATAL: assert-fatal.asm(1):
Assertion failed: there are four lights
FATAL: Assertion failed: there are four lights
at assert-fatal.asm(1)

View File

@@ -1,3 +1,3 @@
error: assert-nosect-bank.asm(1):
PC has no bank outside of a section
error: PC has no bank outside of a section
at assert-nosect-bank.asm(1)
Assembly aborted with 1 error!

View File

@@ -1,12 +1,12 @@
error: assert.asm(4):
Assertion failed
error: assert.asm(7):
Assertion failed: @ ain't 0 now? (Hint: it's $1)
warning: assert.asm(10): [-Wassert]
Assertion failed
error: assert.asm(18):
Expected constant expression: 'FloatingBase' is not constant at assembly time
error: assert.asm(18):
Assertion failed
FATAL: assert.asm(21):
Assertion failed
error: Assertion failed
at assert.asm(4)
error: Assertion failed: @ ain't 0 now? (Hint: it's $1)
at assert.asm(7)
warning: Assertion failed [-Wassert]
at assert.asm(10)
error: Expected constant expression: 'FloatingBase' is not constant at assembly time
at assert.asm(18)
error: Assertion failed
at assert.asm(18)
FATAL: Assertion failed
at assert.asm(21)

View File

@@ -1,3 +1,3 @@
error: assert@-no-sect.asm(1):
PC has no value outside of a section
error: PC has no value outside of a section
at assert@-no-sect.asm(1)
Assembly aborted with 1 error!

View File

@@ -0,0 +1,15 @@
macro careful
if _NARG == 20
warn "You're in too deep!"
else
careful \#, deeper
endc
endm
careful surface
macro recurse
recurse
endm
rept 3
recurse
endr

View File

@@ -0,0 +1,14 @@
warning: You're in too deep! [-Wuser]
at backtrace-depth.asm::careful(3)
<- backtrace-depth.asm::careful(5)
<- backtrace-depth.asm::careful(5)
...16 more...
<- backtrace-depth.asm::careful(5)
<- backtrace-depth.asm(8)
FATAL: Recursion limit (64) exceeded
at backtrace-depth.asm::recurse(11)
<- backtrace-depth.asm::recurse(11)
<- backtrace-depth.asm::recurse(11)
...60 more...
<- backtrace-depth.asm::REPT~1(14)
<- backtrace-depth.asm(13)

View File

@@ -0,0 +1 @@
-B 5

View File

@@ -1,3 +1,3 @@
error: bad-precision.asm(1):
Fixed-point precision must be between 1 and 31, not 42
error: Fixed-point precision must be between 1 and 31, not 42
at bad-precision.asm(1)
Assembly aborted with 1 error!

View File

@@ -1,23 +1,23 @@
error: bank.asm(13) -> bank.asm::def_sect(8):
Expected constant expression: Section "ROMX_ok1"'s bank is not known
error: bank.asm(13) -> bank.asm::def_sect(8):
Expected constant expression: "Label_u3"'s bank is not known
error: bank.asm(15) -> bank.asm::def_sect(8):
Expected constant expression: Section "ROMX_bad"'s bank is not known
error: bank.asm(15) -> bank.asm::def_sect(8):
Expected constant expression: "Label_u5"'s bank is not known
error: bank.asm(17) -> bank.asm::def_sect(8):
Expected constant expression: Section "VRAM_bad"'s bank is not known
error: bank.asm(17) -> bank.asm::def_sect(8):
Expected constant expression: "Label_u7"'s bank is not known
error: bank.asm(19) -> bank.asm::def_sect(8):
Expected constant expression: Section "SRAM_bad"'s bank is not known
error: bank.asm(19) -> bank.asm::def_sect(8):
Expected constant expression: "Label_u9"'s bank is not known
error: bank.asm(22) -> bank.asm::def_sect(8):
Expected constant expression: Section "WRAMX_bad"'s bank is not known
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: Expected constant expression: Section "ROMX_ok1"'s bank is not known
at bank.asm::def_sect(8) <- bank.asm(13)
error: Expected constant expression: "Label_u3"'s bank is not known
at bank.asm::def_sect(8) <- bank.asm(13)
error: Expected constant expression: Section "ROMX_bad"'s bank is not known
at bank.asm::def_sect(8) <- bank.asm(15)
error: Expected constant expression: "Label_u5"'s bank is not known
at bank.asm::def_sect(8) <- bank.asm(15)
error: Expected constant expression: Section "VRAM_bad"'s bank is not known
at bank.asm::def_sect(8) <- bank.asm(17)
error: Expected constant expression: "Label_u7"'s bank is not known
at bank.asm::def_sect(8) <- bank.asm(17)
error: Expected constant expression: Section "SRAM_bad"'s bank is not known
at bank.asm::def_sect(8) <- bank.asm(19)
error: Expected constant expression: "Label_u9"'s bank is not known
at bank.asm::def_sect(8) <- bank.asm(19)
error: Expected constant expression: Section "WRAMX_bad"'s bank is not known
at bank.asm::def_sect(8) <- bank.asm(22)
error: Expected constant expression: "Label_u12"'s bank is not known
at bank.asm::def_sect(8) <- bank.asm(22)
error: BANK argument must be a label
at bank.asm(26)
Assembly aborted with 11 errors!

View File

@@ -1,2 +1,2 @@
warning: block-comment-contents-error.asm(1): [-Wnested-comment]
/* in block comment
warning: /* in block comment [-Wnested-comment]
at block-comment-contents-error.asm(1)

View File

@@ -1,5 +1,5 @@
error: block-comment-termination-error.asm(1):
Unterminated block comment
error: block-comment-termination-error.asm(1):
syntax error, unexpected end of buffer
error: Unterminated block comment
at block-comment-termination-error.asm(1)
error: syntax error, unexpected end of buffer
at block-comment-termination-error.asm(1)
Assembly aborted with 2 errors!

View File

@@ -1,23 +1,23 @@
error: blue-paint.asm(9) -> blue-paint.asm::arg_to_arg(7):
Invalid character '3' after line continuation
error: blue-paint.asm(9) -> blue-paint.asm::arg_to_arg(7):
syntax error, unexpected number
error: blue-paint.asm(9) -> blue-paint.asm::arg_to_arg(7):
Invalid character '}'
error: blue-paint.asm(15) -> blue-paint.asm::arg_to_interp(13):
Invalid character '{'
error: blue-paint.asm(15) -> blue-paint.asm::arg_to_interp(13):
Invalid character '}'
error: blue-paint.asm(26) -> blue-paint.asm::endless(24):
Invalid character '1' after line continuation
error: blue-paint.asm(26) -> blue-paint.asm::endless(24):
syntax error, unexpected number
FATAL: blue-paint.asm(30):
Recursion limit (5) exceeded
while expanding symbol "infinite"
while expanding symbol "infinite"
while expanding symbol "infinite"
while expanding symbol "infinite"
while expanding symbol "infinite"
while expanding symbol "infinite"
while expanding symbol "infinite"
error: Invalid character '3' after line continuation
at blue-paint.asm::arg_to_arg(7) <- blue-paint.asm(9)
error: syntax error, unexpected number
at blue-paint.asm::arg_to_arg(7) <- blue-paint.asm(9)
error: Invalid character '}'
at blue-paint.asm::arg_to_arg(7) <- blue-paint.asm(9)
error: Invalid character '{'
at blue-paint.asm::arg_to_interp(13) <- blue-paint.asm(15)
error: Invalid character '}'
at blue-paint.asm::arg_to_interp(13) <- blue-paint.asm(15)
error: Invalid character '1' after line continuation
at blue-paint.asm::endless(24) <- blue-paint.asm(26)
error: syntax error, unexpected number
at blue-paint.asm::endless(24) <- blue-paint.asm(26)
FATAL: Recursion limit (5) exceeded
at blue-paint.asm(30)
while expanding symbol "infinite"
while expanding symbol "infinite"
while expanding symbol "infinite"
while expanding symbol "infinite"
while expanding symbol "infinite"
while expanding symbol "infinite"
while expanding symbol "infinite"

View File

@@ -1,13 +1,13 @@
error: bracketed-macro-args.asm(33) -> bracketed-macro-args.asm::bad(26):
Bracketed symbol "nonnumeric" is not numeric
error: bracketed-macro-args.asm(33) -> bracketed-macro-args.asm::bad(27):
Invalid bracketed macro argument '\<0>'
error: bracketed-macro-args.asm(33) -> bracketed-macro-args.asm::bad(28):
Bracketed symbol "undefined" does not exist
error: bracketed-macro-args.asm(33) -> bracketed-macro-args.asm::bad(29):
Macro argument '\<2>' not defined
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: Bracketed symbol "nonnumeric" is not numeric
at bracketed-macro-args.asm::bad(26) <- bracketed-macro-args.asm(33)
error: Invalid bracketed macro argument '\<0>'
at bracketed-macro-args.asm::bad(27) <- bracketed-macro-args.asm(33)
error: Bracketed symbol "undefined" does not exist
at bracketed-macro-args.asm::bad(28) <- bracketed-macro-args.asm(33)
error: Macro argument '\<2>' not defined
at bracketed-macro-args.asm::bad(29) <- bracketed-macro-args.asm(33)
error: Macro argument '\<2>' not defined
at bracketed-macro-args.asm::bad(30) <- bracketed-macro-args.asm(33)
error: Bracketed symbol "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz" does not exist
at bracketed-macro-args.asm::toolong(36) <- bracketed-macro-args.asm(39)
Assembly aborted with 6 errors!

View File

@@ -1,7 +1,7 @@
error: bracketed-symbols.asm(16):
Formatting string as type 'X'
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: Formatting string as type 'X'
at bracketed-symbols.asm(16)
error: "Label" does not have a constant value
at bracketed-symbols.asm(20)
error: PC does not have a constant value; the current section is not fixed
at bracketed-symbols.asm(21)
Assembly aborted with 3 errors!

View File

@@ -1,8 +1,8 @@
warning: break.asm(9): [-Wuser]
done 5
warning: break.asm(28): [-Wuser]
OK
error: break.asm(29):
BREAK can only be used inside a REPT/FOR block
FATAL: break.asm(30) -> break.asm::REPT~1(34):
Ended block with 1 unterminated IF construct
warning: done 5 [-Wuser]
at break.asm(9)
warning: OK [-Wuser]
at break.asm(28)
error: BREAK can only be used inside a REPT/FOR block
at break.asm(29)
FATAL: Ended block with 1 unterminated IF construct
at break.asm::REPT~1(34) <- break.asm(30)

View File

@@ -1,57 +1,57 @@
error: builtin-overwrite.asm(36) -> builtin-overwrite.asm::tickle(5):
Built-in symbol '__UTC_YEAR__' cannot be purged
error: builtin-overwrite.asm(36) -> builtin-overwrite.asm::tickle(6):
Built-in symbol '__UTC_YEAR__' cannot be purged
error: builtin-overwrite.asm(36) -> builtin-overwrite.asm::tickle(9):
'__UTC_YEAR__' already defined at <builtin>
error: builtin-overwrite.asm(36) -> builtin-overwrite.asm::tickle(10):
'__UTC_YEAR__' already defined at <builtin>
error: builtin-overwrite.asm(36) -> builtin-overwrite.asm::tickle(13):
'__UTC_YEAR__' already defined as constant at <builtin>
error: builtin-overwrite.asm(36) -> builtin-overwrite.asm::tickle(14):
'__UTC_YEAR__' already defined as constant at <builtin>
error: builtin-overwrite.asm(36) -> builtin-overwrite.asm::tickle(17):
'__UTC_YEAR__' already defined at <builtin>
error: builtin-overwrite.asm(36) -> builtin-overwrite.asm::tickle(18):
'__UTC_YEAR__' already defined at <builtin>
error: builtin-overwrite.asm(36) -> builtin-overwrite.asm::tickle(21):
'__UTC_YEAR__' already defined as constant at <builtin>
error: builtin-overwrite.asm(36) -> builtin-overwrite.asm::tickle(22):
'__UTC_YEAR__' already defined as constant at <builtin>
error: builtin-overwrite.asm(36) -> builtin-overwrite.asm::tickle(25):
Built-in symbol '__UTC_YEAR__' cannot be redefined
error: builtin-overwrite.asm(36) -> builtin-overwrite.asm::tickle(26):
Built-in symbol '__UTC_YEAR__' cannot be redefined
error: builtin-overwrite.asm(36) -> builtin-overwrite.asm::tickle(29):
'__UTC_YEAR__' already defined as non-EQUS at <builtin>
error: builtin-overwrite.asm(36) -> builtin-overwrite.asm::tickle(30):
'__UTC_YEAR__' already defined as non-EQUS at <builtin>
error: builtin-overwrite.asm(37) -> builtin-overwrite.asm::tickle(5):
Built-in symbol '__ISO_8601_UTC__' cannot be purged
error: builtin-overwrite.asm(37) -> builtin-overwrite.asm::tickle(6):
Built-in symbol '__ISO_8601_UTC__' cannot be purged
error: builtin-overwrite.asm(37) -> builtin-overwrite.asm::tickle(9):
'__ISO_8601_UTC__' already defined at <builtin>
error: builtin-overwrite.asm(37) -> builtin-overwrite.asm::tickle(10):
'__ISO_8601_UTC__' already defined at <builtin>
error: builtin-overwrite.asm(37) -> builtin-overwrite.asm::tickle(13):
'__ISO_8601_UTC__' already defined as constant at <builtin>
error: builtin-overwrite.asm(37) -> builtin-overwrite.asm::tickle(14):
'__ISO_8601_UTC__' already defined as constant at <builtin>
error: builtin-overwrite.asm(37) -> builtin-overwrite.asm::tickle(17):
'__ISO_8601_UTC__' already defined at <builtin>
error: builtin-overwrite.asm(37) -> builtin-overwrite.asm::tickle(18):
'__ISO_8601_UTC__' already defined at <builtin>
error: builtin-overwrite.asm(37) -> builtin-overwrite.asm::tickle(21):
'__ISO_8601_UTC__' already defined as constant at <builtin>
error: builtin-overwrite.asm(37) -> builtin-overwrite.asm::tickle(22):
'__ISO_8601_UTC__' already defined as constant at <builtin>
error: builtin-overwrite.asm(37) -> builtin-overwrite.asm::tickle(25):
'__ISO_8601_UTC__' already defined as non-EQU at <builtin>
error: builtin-overwrite.asm(37) -> builtin-overwrite.asm::tickle(26):
'__ISO_8601_UTC__' already defined as non-EQU at <builtin>
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: Built-in symbol '__UTC_YEAR__' cannot be purged
at builtin-overwrite.asm::tickle(5) <- builtin-overwrite.asm(36)
error: Built-in symbol '__UTC_YEAR__' cannot be purged
at builtin-overwrite.asm::tickle(6) <- builtin-overwrite.asm(36)
error: '__UTC_YEAR__' already defined as built-in
at builtin-overwrite.asm::tickle(9) <- builtin-overwrite.asm(36)
error: '__UTC_YEAR__' already defined as built-in
at builtin-overwrite.asm::tickle(10) <- builtin-overwrite.asm(36)
error: '__UTC_YEAR__' already defined as built-in constant
at builtin-overwrite.asm::tickle(13) <- builtin-overwrite.asm(36)
error: '__UTC_YEAR__' already defined as built-in constant
at builtin-overwrite.asm::tickle(14) <- builtin-overwrite.asm(36)
error: '__UTC_YEAR__' already defined as built-in
at builtin-overwrite.asm::tickle(17) <- builtin-overwrite.asm(36)
error: '__UTC_YEAR__' already defined as built-in
at builtin-overwrite.asm::tickle(18) <- builtin-overwrite.asm(36)
error: '__UTC_YEAR__' already defined as built-in constant
at builtin-overwrite.asm::tickle(21) <- builtin-overwrite.asm(36)
error: '__UTC_YEAR__' already defined as built-in constant
at builtin-overwrite.asm::tickle(22) <- builtin-overwrite.asm(36)
error: Built-in symbol '__UTC_YEAR__' cannot be redefined
at builtin-overwrite.asm::tickle(25) <- builtin-overwrite.asm(36)
error: Built-in symbol '__UTC_YEAR__' cannot be redefined
at builtin-overwrite.asm::tickle(26) <- builtin-overwrite.asm(36)
error: '__UTC_YEAR__' already defined as built-in non-EQUS
at builtin-overwrite.asm::tickle(29) <- builtin-overwrite.asm(36)
error: '__UTC_YEAR__' already defined as built-in non-EQUS
at builtin-overwrite.asm::tickle(30) <- builtin-overwrite.asm(36)
error: Built-in symbol '__ISO_8601_UTC__' cannot be purged
at builtin-overwrite.asm::tickle(5) <- builtin-overwrite.asm(37)
error: Built-in symbol '__ISO_8601_UTC__' cannot be purged
at builtin-overwrite.asm::tickle(6) <- builtin-overwrite.asm(37)
error: '__ISO_8601_UTC__' already defined as built-in
at builtin-overwrite.asm::tickle(9) <- builtin-overwrite.asm(37)
error: '__ISO_8601_UTC__' already defined as built-in
at builtin-overwrite.asm::tickle(10) <- builtin-overwrite.asm(37)
error: '__ISO_8601_UTC__' already defined as built-in constant
at builtin-overwrite.asm::tickle(13) <- builtin-overwrite.asm(37)
error: '__ISO_8601_UTC__' already defined as built-in constant
at builtin-overwrite.asm::tickle(14) <- builtin-overwrite.asm(37)
error: '__ISO_8601_UTC__' already defined as built-in
at builtin-overwrite.asm::tickle(17) <- builtin-overwrite.asm(37)
error: '__ISO_8601_UTC__' already defined as built-in
at builtin-overwrite.asm::tickle(18) <- builtin-overwrite.asm(37)
error: '__ISO_8601_UTC__' already defined as built-in constant
at builtin-overwrite.asm::tickle(21) <- builtin-overwrite.asm(37)
error: '__ISO_8601_UTC__' already defined as built-in constant
at builtin-overwrite.asm::tickle(22) <- builtin-overwrite.asm(37)
error: '__ISO_8601_UTC__' already defined as built-in non-EQU
at builtin-overwrite.asm::tickle(25) <- builtin-overwrite.asm(37)
error: '__ISO_8601_UTC__' already defined as built-in non-EQU
at builtin-overwrite.asm::tickle(26) <- builtin-overwrite.asm(37)
error: Built-in symbol '__ISO_8601_UTC__' cannot be redefined
at builtin-overwrite.asm::tickle(29) <- builtin-overwrite.asm(37)
error: Built-in symbol '__ISO_8601_UTC__' cannot be redefined
at builtin-overwrite.asm::tickle(30) <- builtin-overwrite.asm(37)
Assembly aborted with 28 errors!

View File

@@ -1,33 +1,33 @@
error: builtin-reserved.asm(3):
Undefined symbol '_NARG'
error: builtin-reserved.asm(5):
'_NARG' is reserved for a built-in symbol
error: builtin-reserved.asm(6):
'_NARG' is reserved for a built-in symbol
error: builtin-reserved.asm(8):
'_NARG' is reserved for a built-in symbol
error: builtin-reserved.asm(9):
'_NARG' is reserved for a built-in symbol
error: builtin-reserved.asm(11):
'_NARG' is reserved for a built-in symbol
error: builtin-reserved.asm(12):
'_NARG' is reserved for a built-in symbol
error: builtin-reserved.asm(15):
'_NARG' is reserved for a built-in symbol
error: builtin-reserved.asm(20):
Undefined symbol '.'
error: builtin-reserved.asm(22):
'.' is reserved for a built-in symbol
error: builtin-reserved.asm(23):
'.' is reserved for a built-in symbol
error: builtin-reserved.asm(25):
'.' is reserved for a built-in symbol
error: builtin-reserved.asm(26):
'.' is reserved for a built-in symbol
error: builtin-reserved.asm(28):
'.' is reserved for a built-in symbol
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: Undefined symbol '_NARG'
at builtin-reserved.asm(3)
error: '_NARG' is reserved for a built-in symbol
at builtin-reserved.asm(5)
error: '_NARG' is reserved for a built-in symbol
at builtin-reserved.asm(6)
error: '_NARG' is reserved for a built-in constant symbol
at builtin-reserved.asm(8)
error: '_NARG' is reserved for a built-in constant symbol
at builtin-reserved.asm(9)
error: '_NARG' is reserved for a built-in symbol
at builtin-reserved.asm(11)
error: '_NARG' is reserved for a built-in non-EQUS symbol
at builtin-reserved.asm(12)
error: '_NARG' is reserved for a built-in symbol
at builtin-reserved.asm(15)
error: Undefined symbol '.'
at builtin-reserved.asm(20)
error: '.' is reserved for a built-in symbol
at builtin-reserved.asm(22)
error: '.' is reserved for a built-in non-EQU symbol
at builtin-reserved.asm(23)
error: '.' is reserved for a built-in constant symbol
at builtin-reserved.asm(25)
error: '.' is reserved for a built-in constant symbol
at builtin-reserved.asm(26)
error: '.' is reserved for a built-in symbol
at builtin-reserved.asm(28)
error: '.' is reserved for a built-in symbol
at builtin-reserved.asm(29)
error: "." has no value outside of a label scope
at builtin-reserved.asm(32)
Assembly aborted with 16 errors!

View File

@@ -1,4 +1,4 @@
warning: bytelen-strbyte.asm(35): [-Wbuiltin-args]
STRBYTE: Index starts at 0
warning: bytelen-strbyte.asm(36): [-Wbuiltin-args]
STRBYTE: Index 10 is past the end of the string
warning: STRBYTE: Index starts at 0 [-Wbuiltin-args]
at bytelen-strbyte.asm(35)
warning: STRBYTE: Index 10 is past the end of the string [-Wbuiltin-args]
at bytelen-strbyte.asm(36)

View File

@@ -1,5 +1,5 @@
error: character-escape-at-end.asm(1):
Illegal character escape at end of input
error: character-escape-at-end.asm(1):
Unterminated string
error: Illegal character escape at end of input
at character-escape-at-end.asm(1)
error: Unterminated string
at character-escape-at-end.asm(1)
Assembly aborted with 2 errors!

View File

@@ -1,7 +1,7 @@
error: character-escapes.asm(10) -> character-escapes.asm::m(6):
Illegal character escape 'z'
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 '\t' in bracketed macro argument
error: Illegal character escape 'z'
at character-escapes.asm::m(6) <- character-escapes.asm(10)
error: Invalid character '\' in bracketed macro argument
at character-escapes.asm::m(7) <- character-escapes.asm(10)
error: Invalid character '\t' in bracketed macro argument
at character-escapes.asm::m(8) <- character-escapes.asm(10)
Assembly aborted with 3 errors!

View File

@@ -1,19 +1,19 @@
warning: character-literals.asm(31) -> character-literals.asm::char(13): [-Wunmapped-char]
Unmapped character '?'
error: character-literals.asm(32) -> character-literals.asm::char(13):
Character literals must be a single charmap unit
error: character-literals.asm(33) -> character-literals.asm::char(13):
Character literals must be a single charmap unit
warning: character-literals.asm(34) -> character-literals.asm::char(13): [-Wunmapped-char]
Unmapped character '\n'
warning: character-literals.asm(34) -> character-literals.asm::char(13): [-Wunmapped-char]
Unmapped character '\r'
warning: character-literals.asm(34) -> character-literals.asm::char(13): [-Wunmapped-char]
Unmapped character '\t'
error: character-literals.asm(34) -> character-literals.asm::char(13):
Character literals must be a single charmap unit
error: character-literals.asm(35):
Unterminated character
error: character-literals.asm(35):
Character literals must be a single charmap unit
warning: Unmapped character '?' [-Wunmapped-char]
at character-literals.asm::char(13) <- character-literals.asm(31)
error: Character literals must be a single charmap unit
at character-literals.asm::char(13) <- character-literals.asm(32)
error: Character literals must be a single charmap unit
at character-literals.asm::char(13) <- character-literals.asm(33)
warning: Unmapped character '\n' [-Wunmapped-char]
at character-literals.asm::char(13) <- character-literals.asm(34)
warning: Unmapped character '\r' [-Wunmapped-char]
at character-literals.asm::char(13) <- character-literals.asm(34)
warning: Unmapped character '\t' [-Wunmapped-char]
at character-literals.asm::char(13) <- character-literals.asm(34)
error: Character literals must be a single charmap unit
at character-literals.asm::char(13) <- character-literals.asm(34)
error: Unterminated character
at character-literals.asm(35)
error: Character literals must be a single charmap unit
at character-literals.asm(35)
Assembly aborted with 5 errors!

View File

@@ -1,5 +1,5 @@
error: charmap-empty.asm(1):
Cannot map an empty string
error: charmap-empty.asm(2):
syntax error, unexpected end of line
error: Cannot map an empty string
at charmap-empty.asm(1)
error: syntax error, unexpected end of line
at charmap-empty.asm(2)
Assembly aborted with 2 errors!

View File

@@ -1,3 +1,3 @@
error: charmap-inheritance.asm(26):
Base charmap 'eggs' doesn't exist
error: Base charmap 'eggs' doesn't exist
at charmap-inheritance.asm(26)
Assembly aborted with 1 error!

View File

@@ -1,9 +1,9 @@
error: charsize.asm(17):
CHARSIZE: No character mapping for ""
error: charsize.asm(18):
CHARSIZE: No character mapping for "hello world"
error: charsize.asm(19):
CHARSIZE: No character mapping for "abcdef"
error: charsize.asm(20):
CHARSIZE: No character mapping for "é"
error: CHARSIZE: No character mapping for ""
at charsize.asm(17)
error: CHARSIZE: No character mapping for "hello world"
at charsize.asm(18)
error: CHARSIZE: No character mapping for "abcdef"
at charsize.asm(19)
error: CHARSIZE: No character mapping for "é"
at charsize.asm(20)
Assembly aborted with 4 errors!

View File

@@ -1,15 +1,15 @@
error: charval.asm(23):
CHARVAL: Character mapping for "b" must have a single value
error: charval.asm(24):
CHARVAL: No character mapping for "ab"
error: charval.asm(25):
CHARVAL: No character mapping for "abc"
error: charval.asm(26):
CHARVAL: No character mapping for "cd"
error: charval.asm(27):
CHARVAL: No character mapping for "xyz"
warning: charval.asm(28): [-Wbuiltin-args]
CHARVAL: Index starts at 0
warning: charval.asm(29): [-Wbuiltin-args]
CHARVAL: Index 10 is past the end of the character mapping
error: CHARVAL: Character mapping for "b" must have a single value
at charval.asm(23)
error: CHARVAL: No character mapping for "ab"
at charval.asm(24)
error: CHARVAL: No character mapping for "abc"
at charval.asm(25)
error: CHARVAL: No character mapping for "cd"
at charval.asm(26)
error: CHARVAL: No character mapping for "xyz"
at charval.asm(27)
warning: CHARVAL: Index starts at 0 [-Wbuiltin-args]
at charval.asm(28)
warning: CHARVAL: Index 10 is past the end of the character mapping [-Wbuiltin-args]
at charval.asm(29)
Assembly aborted with 5 errors!

View File

@@ -1,15 +1,15 @@
error: code-after-endm-endr-endc.asm(6):
syntax error, unexpected PRINTLN, expecting end of line or end of buffer or end of fragment literal
error: code-after-endm-endr-endc.asm(7):
Undefined macro "mac"
error: code-after-endm-endr-endc.asm(12):
syntax error, unexpected PRINTLN, expecting end of line or end of buffer or end of fragment literal
error: code-after-endm-endr-endc.asm(17):
syntax error, unexpected PRINTLN, expecting end of line
error: code-after-endm-endr-endc.asm(19):
syntax error, unexpected PRINTLN, expecting end of line or end of buffer or end of fragment literal
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 or end of fragment literal
error: syntax error, unexpected PRINTLN, expecting end of line or end of buffer or end of fragment literal
at code-after-endm-endr-endc.asm(6)
error: Undefined macro "mac"
at code-after-endm-endr-endc.asm(7)
error: syntax error, unexpected PRINTLN, expecting end of line or end of buffer or end of fragment literal
at code-after-endm-endr-endc.asm(12)
error: syntax error, unexpected PRINTLN, expecting end of line
at code-after-endm-endr-endc.asm(17)
error: syntax error, unexpected PRINTLN, expecting end of line or end of buffer or end of fragment literal
at code-after-endm-endr-endc.asm(19)
error: syntax error, unexpected PRINTLN, expecting end of line
at code-after-endm-endr-endc.asm(23)
error: syntax error, unexpected PRINTLN, expecting end of line or end of buffer or end of fragment literal
at code-after-endm-endr-endc.asm(25)
Assembly aborted with 7 errors!

View File

@@ -1,4 +1,5 @@
error: command-line-symbols.asm(3):
'FOO' already defined at <command-line>
(should it be {interpolated} to define its contents "hello"?)
error: 'FOO' already defined (should it be {interpolated} to define its contents "hello"?)
at command-line-symbols.asm(3)
and also:
at <command-line>
Assembly aborted with 1 error!

View File

@@ -1,3 +1,3 @@
error: compound-assignment.asm(35):
Expected constant expression: 'UnDeFiNeD' is not constant at assembly time
error: Expected constant expression: 'UnDeFiNeD' is not constant at assembly time
at compound-assignment.asm(35)
Assembly aborted with 1 error!

View File

@@ -1,9 +1,9 @@
error: const-and.asm(2):
PC has no value outside of a section
error: const-and.asm(11):
Expected constant expression: 'Aligned' is not constant at assembly time
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: PC has no value outside of a section
at const-and.asm(2)
error: Expected constant expression: 'Aligned' is not constant at assembly time
at const-and.asm(11)
error: Expected constant expression: PC is not constant at assembly time
at const-and.asm(17)
error: Expected constant expression: 'Floating' is not constant at assembly time
at const-and.asm(20)
Assembly aborted with 4 errors!

View File

@@ -1,3 +1,3 @@
error: const-not.asm(3):
Assertion failed
error: Assertion failed
at const-not.asm(3)
Assembly aborted with 1 error!

View File

@@ -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: Expected constant expression: PC is not constant at assembly time
at const-zero.asm::test_or(14) <- const-zero.asm(21)
Assembly aborted with 1 error!

View File

@@ -1,4 +1,4 @@
warning: continues-after-missing-include/a.asm(7): [-Wuser]
still going!
warning: continues-after-missing-include/a.asm(9): [-Wuser]
and going!
warning: still going! [-Wuser]
at continues-after-missing-include/a.asm(7)
warning: and going! [-Wuser]
at continues-after-missing-include/a.asm(9)

View File

@@ -1,4 +1,4 @@
warning: correct-line-number.asm(5): [-Wuser]
Am I geting ahead of myself?
warning: correct-line-number.asm(11): [-Wuser]
Hopefully not.
warning: Am I geting ahead of myself? [-Wuser]
at correct-line-number.asm(5)
warning: Hopefully not. [-Wuser]
at correct-line-number.asm(11)

View File

@@ -1,5 +1,5 @@
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: Section 'code' cannot contain code or data (not ROM0 or ROMX)
at data-in-ram.asm(2)
error: Section 'data' cannot contain code or data (not ROM0 or ROMX)
at data-in-ram.asm(4)
Assembly aborted with 2 errors!

View File

@@ -1,4 +1,4 @@
warning: date-time.asm(2): [-Wobsolete]
`__DATE__` is deprecated; use `__ISO_8601_LOCAL__`
warning: date-time.asm(3): [-Wobsolete]
`__TIME__` is deprecated; use `__ISO_8601_LOCAL__`
warning: `__DATE__` is deprecated; use `__ISO_8601_LOCAL__` [-Wobsolete]
at date-time.asm(2)
warning: `__TIME__` is deprecated; use `__ISO_8601_LOCAL__` [-Wobsolete]
at date-time.asm(3)

View File

@@ -1,7 +1,7 @@
error: def-scoped.asm(10):
syntax error, unexpected local label, expecting symbol
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: syntax error, unexpected local label, expecting symbol
at def-scoped.asm(10)
error: syntax error, unexpected local label, expecting symbol
at def-scoped.asm(13)
error: syntax error, unexpected local label, expecting symbol
at def-scoped.asm(16)
Assembly aborted with 3 errors!

View File

@@ -1,11 +1,17 @@
error: def.asm(23):
'constant' already defined at def.asm(10)
error: def.asm(35):
'mac' already defined as non-EQU at def.asm(32)
error: def.asm(38):
'name' already defined at def.asm(37)
(should it be {interpolated} to define its contents "constant2"?)
error: def.asm(42):
'name' already defined at def.asm(40)
(should it be {interpolated} to define its contents "mac2"?)
error: 'constant' already defined
at def.asm(23)
and also:
at def.asm(10)
error: 'mac' already defined as non-EQU
at def.asm(35)
and also:
at def.asm(32)
error: 'name' already defined (should it be {interpolated} to define its contents "constant2"?)
at def.asm(38)
and also:
at def.asm(37)
error: 'name' already defined (should it be {interpolated} to define its contents "mac2"?)
at def.asm(42)
and also:
at def.asm(40)
Assembly aborted with 4 errors!

View File

@@ -1,5 +1,5 @@
warning: Invalid warning flag parameter "truncation=256"; capping at maximum 2
warning: diagnostic-parameter-cap.asm(3): [-Wtruncation]
Expression must be 8-bit; use LOW() to force 8-bit
warning: diagnostic-parameter-cap.asm(4): [-Wtruncation]
Expression must be 8-bit; use LOW() to force 8-bit
warning: Expression must be 8-bit; use LOW() to force 8-bit [-Wtruncation]
at diagnostic-parameter-cap.asm(3)
warning: Expression must be 8-bit; use LOW() to force 8-bit [-Wtruncation]
at diagnostic-parameter-cap.asm(4)

View File

@@ -1,5 +1,5 @@
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: syntax error, unexpected - at the beginning of the line (is it a leftover diff mark?)
at diff-marks.asm(2)
error: syntax error, unexpected + at the beginning of the line (is it a leftover diff mark?)
at diff-marks.asm(3)
Assembly aborted with 2 errors!

View File

@@ -1,2 +1,2 @@
FATAL: divzero-instr.asm(2):
Division by zero
FATAL: Division by zero
at divzero-instr.asm(2)

View File

@@ -1,2 +1,2 @@
FATAL: divzero-section-bank.asm(1):
Division by zero
FATAL: Division by zero
at divzero-section-bank.asm(1)

View File

@@ -1,3 +1,3 @@
error: double-purge.asm(3):
Undefined symbol 'n' was already purged
error: Undefined symbol 'n' was already purged
at double-purge.asm(3)
Assembly aborted with 1 error!

View File

@@ -1,5 +1,5 @@
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: Expected constant expression: 'unknown' is not constant at assembly time
at ds-bad.asm(3)
warning: Expression must be 8-bit; use LOW() to force 8-bit [-Wtruncation]
at ds-bad.asm(4)
Assembly aborted with 1 error!

View File

@@ -1,4 +1,6 @@
error: duplicate-section.asm(4):
Section already defined previously at duplicate-section.asm(2)
FATAL: duplicate-section.asm(4):
Cannot create section "sec" (1 error)
error: Section already defined
at duplicate-section.asm(4)
and also:
at duplicate-section.asm(2)
FATAL: Cannot create section "sec" (1 error)
at duplicate-section.asm(4)

View File

@@ -1,2 +1,2 @@
FATAL: elif-after-else.asm(14):
Found ELIF after an ELSE block
FATAL: Found ELIF after an ELSE block
at elif-after-else.asm(14)

View File

@@ -1,2 +1,2 @@
FATAL: elif-after-taken-if.asm(21):
Division by zero
FATAL: Division by zero
at elif-after-taken-if.asm(21)

View File

@@ -1,2 +1,2 @@
FATAL: elif-outside-if.asm(1):
Found ELIF outside of an IF construct
FATAL: Found ELIF outside of an IF construct
at elif-outside-if.asm(1)

View File

@@ -1,2 +1,2 @@
FATAL: else-outside-if.asm(1):
Found ELSE outside of an IF construct
FATAL: Found ELSE outside of an IF construct
at else-outside-if.asm(1)

View File

@@ -1,6 +1,6 @@
warning: empty-data-directive.asm(6): [-Wempty-data-directive]
DB directive without data in ROM
warning: empty-data-directive.asm(7): [-Wempty-data-directive]
DW directive without data in ROM
warning: empty-data-directive.asm(8): [-Wempty-data-directive]
DL directive without data in ROM
warning: DB directive without data in ROM [-Wempty-data-directive]
at empty-data-directive.asm(6)
warning: DW directive without data in ROM [-Wempty-data-directive]
at empty-data-directive.asm(7)
warning: DL directive without data in ROM [-Wempty-data-directive]
at empty-data-directive.asm(8)

View File

@@ -1,2 +1,2 @@
FATAL: empty-local-purged.asm(3):
Unqualified local label '.test' in main scope
FATAL: Unqualified local label '.test' in main scope
at empty-local-purged.asm(3)

View File

@@ -1,2 +1,2 @@
FATAL: empty-local-referenced.asm(3):
'Referenced.' is a nonsensical reference to an empty local label
FATAL: 'Referenced.' is a nonsensical reference to an empty local label
at empty-local-referenced.asm(3)

View File

@@ -1,2 +1,2 @@
FATAL: empty-local-used.asm(4):
'Label.' is a nonsensical reference to an empty local label
FATAL: 'Label.' is a nonsensical reference to an empty local label
at empty-local-used.asm(4)

View File

@@ -1,2 +1,2 @@
FATAL: empty-local.asm(4):
'Label.' is a nonsensical reference to an empty local label
FATAL: 'Label.' is a nonsensical reference to an empty local label
at empty-local.asm(4)

View File

@@ -1,5 +1,5 @@
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: Invalid character '?' in bracketed macro argument
at empty-raw-identifier.asm::macro(3) <- empty-raw-identifier.asm(5)
error: Empty raw symbol in bracketed macro argument
at empty-raw-identifier.asm::macro(3) <- empty-raw-identifier.asm(5)
Assembly aborted with 2 errors!

View File

@@ -1,5 +1,5 @@
warning: empty-strings.asm(5): [-Wobsolete]
Treating strings as numbers is deprecated
error: empty-strings.asm(5):
Strings as numbers must be a single charmap unit
warning: Treating strings as numbers is deprecated [-Wobsolete]
at empty-strings.asm(5)
error: Strings as numbers must be a single charmap unit
at empty-strings.asm(5)
Assembly aborted with 1 error!

View File

@@ -1,2 +1,2 @@
FATAL: endc-outside-if.asm(1):
Found ENDC outside of an IF construct
FATAL: Found ENDC outside of an IF construct
at endc-outside-if.asm(1)

View File

@@ -1,5 +1,5 @@
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
warning: `LOAD` block without `ENDL` terminated by `ENDSECTION` [-Wunterminated-load]
at endsection-in-load.asm(3)
error: Found `ENDL` outside of a `LOAD` block
at endsection-in-load.asm(4)
Assembly aborted with 1 error!

View File

@@ -1,2 +1,2 @@
FATAL: endsection-in-union.asm(3):
Cannot end the section within a UNION
FATAL: Cannot end the section within a UNION
at endsection-in-union.asm(3)

View File

@@ -1,2 +1,2 @@
FATAL: endsection-outside-section.asm(1):
Cannot end the section outside of a SECTION
FATAL: Cannot end the section outside of a SECTION
at endsection-outside-section.asm(1)

View File

@@ -1,3 +1,3 @@
error: endsection.asm(4):
Cannot output data outside of a SECTION
error: Cannot output data outside of a SECTION
at endsection.asm(4)
Assembly aborted with 1 error!

View File

@@ -1,7 +1,7 @@
warning: equs-newline.asm(3): [-Wuser]
First
while expanding symbol "ACT"
warning: equs-newline.asm(3): [-Wuser]
Second
warning: equs-newline.asm(4): [-Wuser]
Third
warning: First [-Wuser]
at equs-newline.asm(3)
while expanding symbol "ACT"
warning: Second [-Wuser]
at equs-newline.asm(3)
warning: Third [-Wuser]
at equs-newline.asm(4)

View File

@@ -1,3 +1,3 @@
warning: equs-purge.asm(2): [-Wuser]
Crash?
while expanding symbol "BYE"
warning: Crash? [-Wuser]
at equs-purge.asm(2)
while expanding symbol "BYE"

Some files were not shown because too many files have changed in this diff Show More