mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Remove errx and errors.hpp (#1737)
This commit is contained in:
21
Makefile
21
Makefile
@@ -49,7 +49,12 @@ BASE_REF := origin/master
|
|||||||
|
|
||||||
all: rgbasm rgblink rgbfix rgbgfx
|
all: rgbasm rgblink rgbfix rgbgfx
|
||||||
|
|
||||||
|
common_obj := \
|
||||||
|
src/extern/getopt.o \
|
||||||
|
src/diagnostics.o
|
||||||
|
|
||||||
rgbasm_obj := \
|
rgbasm_obj := \
|
||||||
|
${common_obj} \
|
||||||
src/asm/charmap.o \
|
src/asm/charmap.o \
|
||||||
src/asm/fixpoint.o \
|
src/asm/fixpoint.o \
|
||||||
src/asm/format.o \
|
src/asm/format.o \
|
||||||
@@ -64,10 +69,7 @@ rgbasm_obj := \
|
|||||||
src/asm/section.o \
|
src/asm/section.o \
|
||||||
src/asm/symbol.o \
|
src/asm/symbol.o \
|
||||||
src/asm/warning.o \
|
src/asm/warning.o \
|
||||||
src/extern/getopt.o \
|
|
||||||
src/extern/utf8decoder.o \
|
src/extern/utf8decoder.o \
|
||||||
src/diagnostics.o \
|
|
||||||
src/error.o \
|
|
||||||
src/linkdefs.o \
|
src/linkdefs.o \
|
||||||
src/opmath.o \
|
src/opmath.o \
|
||||||
src/util.o
|
src/util.o
|
||||||
@@ -75,6 +77,7 @@ rgbasm_obj := \
|
|||||||
src/asm/lexer.o src/asm/main.o: src/asm/parser.hpp
|
src/asm/lexer.o src/asm/main.o: src/asm/parser.hpp
|
||||||
|
|
||||||
rgblink_obj := \
|
rgblink_obj := \
|
||||||
|
${common_obj} \
|
||||||
src/link/assign.o \
|
src/link/assign.o \
|
||||||
src/link/main.o \
|
src/link/main.o \
|
||||||
src/link/object.o \
|
src/link/object.o \
|
||||||
@@ -85,9 +88,7 @@ rgblink_obj := \
|
|||||||
src/link/section.o \
|
src/link/section.o \
|
||||||
src/link/symbol.o \
|
src/link/symbol.o \
|
||||||
src/link/warning.o \
|
src/link/warning.o \
|
||||||
src/extern/getopt.o \
|
|
||||||
src/extern/utf8decoder.o \
|
src/extern/utf8decoder.o \
|
||||||
src/error.o \
|
|
||||||
src/linkdefs.o \
|
src/linkdefs.o \
|
||||||
src/opmath.o \
|
src/opmath.o \
|
||||||
src/util.o
|
src/util.o
|
||||||
@@ -95,11 +96,11 @@ rgblink_obj := \
|
|||||||
src/link/main.o: src/link/script.hpp
|
src/link/main.o: src/link/script.hpp
|
||||||
|
|
||||||
rgbfix_obj := \
|
rgbfix_obj := \
|
||||||
src/fix/main.o \
|
${common_obj} \
|
||||||
src/extern/getopt.o \
|
src/fix/main.o
|
||||||
src/error.o
|
|
||||||
|
|
||||||
rgbgfx_obj := \
|
rgbgfx_obj := \
|
||||||
|
${common_obj} \
|
||||||
src/gfx/main.o \
|
src/gfx/main.o \
|
||||||
src/gfx/pal_packing.o \
|
src/gfx/pal_packing.o \
|
||||||
src/gfx/pal_sorting.o \
|
src/gfx/pal_sorting.o \
|
||||||
@@ -108,9 +109,7 @@ rgbgfx_obj := \
|
|||||||
src/gfx/proto_palette.o \
|
src/gfx/proto_palette.o \
|
||||||
src/gfx/reverse.o \
|
src/gfx/reverse.o \
|
||||||
src/gfx/rgba.o \
|
src/gfx/rgba.o \
|
||||||
src/gfx/warning.o \
|
src/gfx/warning.o
|
||||||
src/extern/getopt.o \
|
|
||||||
src/error.o
|
|
||||||
|
|
||||||
rgbasm: ${rgbasm_obj}
|
rgbasm: ${rgbasm_obj}
|
||||||
$Q${CXX} ${REALLDFLAGS} -o $@ ${rgbasm_obj} ${REALCXXFLAGS} src/version.cpp -lm
|
$Q${CXX} ${REALLDFLAGS} -o $@ ${rgbasm_obj} ${REALCXXFLAGS} src/version.cpp -lm
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ extern size_t maxRecursionDepth;
|
|||||||
|
|
||||||
struct MacroArgs;
|
struct MacroArgs;
|
||||||
|
|
||||||
void fstk_DumpCurrent();
|
bool fstk_DumpCurrent();
|
||||||
std::shared_ptr<FileStackNode> fstk_GetFileStack();
|
std::shared_ptr<FileStackNode> fstk_GetFileStack();
|
||||||
std::shared_ptr<std::string> fstk_GetUniqueIDStr();
|
std::shared_ptr<std::string> fstk_GetUniqueIDStr();
|
||||||
MacroArgs *fstk_GetCurrentMacroArgs();
|
MacroArgs *fstk_GetCurrentMacroArgs();
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ struct LexerState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void setAsCurrentState();
|
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 setViewAsNextState(char const *name, ContentSpan const &span, uint32_t lineNo_);
|
||||||
|
|
||||||
void clear(uint32_t lineNo_);
|
void clear(uint32_t lineNo_);
|
||||||
|
|||||||
@@ -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,
|
// It is also used when the assembler goes into an invalid state (for example,
|
||||||
// when it fails to allocate memory).
|
// when it fails to allocate memory).
|
||||||
[[gnu::format(printf, 1, 2), noreturn]]
|
[[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
|
// 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
|
// affect the following code. The code will fail to assemble but the user will
|
||||||
|
|||||||
@@ -13,10 +13,12 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "error.hpp"
|
|
||||||
#include "helpers.hpp"
|
#include "helpers.hpp"
|
||||||
#include "itertools.hpp"
|
#include "itertools.hpp"
|
||||||
|
|
||||||
|
[[gnu::format(printf, 1, 2)]]
|
||||||
|
void warnx(char const *fmt, ...);
|
||||||
|
|
||||||
enum WarningAbled { WARNING_DEFAULT, WARNING_ENABLED, WARNING_DISABLED };
|
enum WarningAbled { WARNING_DEFAULT, WARNING_ENABLED, WARNING_DISABLED };
|
||||||
|
|
||||||
struct WarningState {
|
struct WarningState {
|
||||||
|
|||||||
@@ -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
|
|
||||||
@@ -9,14 +9,22 @@ struct FileStackNode;
|
|||||||
|
|
||||||
[[gnu::format(printf, 3, 4)]]
|
[[gnu::format(printf, 3, 4)]]
|
||||||
void warning(FileStackNode const *where, uint32_t lineNo, char const *fmt, ...);
|
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)]]
|
[[gnu::format(printf, 3, 4)]]
|
||||||
void error(FileStackNode const *where, uint32_t lineNo, char const *fmt, ...);
|
void error(FileStackNode const *where, uint32_t lineNo, char const *fmt, ...);
|
||||||
[[gnu::format(printf, 1, 2)]]
|
[[gnu::format(printf, 1, 2)]]
|
||||||
|
void error(char const *fmt, ...);
|
||||||
|
[[gnu::format(printf, 1, 2)]]
|
||||||
void errorNoDump(char const *fmt, ...);
|
void errorNoDump(char const *fmt, ...);
|
||||||
[[gnu::format(printf, 2, 3)]]
|
[[gnu::format(printf, 2, 3)]]
|
||||||
void argErr(char flag, char const *fmt, ...);
|
void argErr(char flag, char const *fmt, ...);
|
||||||
|
|
||||||
[[gnu::format(printf, 3, 4), noreturn]]
|
[[gnu::format(printf, 3, 4), noreturn]]
|
||||||
void fatal(FileStackNode const *where, uint32_t lineNo, char const *fmt, ...);
|
void fatal(FileStackNode const *where, uint32_t lineNo, char const *fmt, ...);
|
||||||
|
[[gnu::format(printf, 1, 2), noreturn]]
|
||||||
|
void fatal(char const *fmt, ...);
|
||||||
|
|
||||||
void requireZeroErrors();
|
void requireZeroErrors();
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
configure_file(version.cpp _version.cpp ESCAPE_QUOTES)
|
configure_file(version.cpp _version.cpp ESCAPE_QUOTES)
|
||||||
|
|
||||||
set(common_src
|
set(common_src
|
||||||
"error.cpp"
|
|
||||||
"extern/getopt.cpp"
|
"extern/getopt.cpp"
|
||||||
|
"diagnostics.cpp"
|
||||||
"_version.cpp"
|
"_version.cpp"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -47,10 +47,7 @@ set(rgbasm_src
|
|||||||
"asm/section.cpp"
|
"asm/section.cpp"
|
||||||
"asm/symbol.cpp"
|
"asm/symbol.cpp"
|
||||||
"asm/warning.cpp"
|
"asm/warning.cpp"
|
||||||
"extern/getopt.cpp"
|
|
||||||
"extern/utf8decoder.cpp"
|
"extern/utf8decoder.cpp"
|
||||||
"diagnostics.cpp"
|
|
||||||
"error.cpp"
|
|
||||||
"linkdefs.cpp"
|
"linkdefs.cpp"
|
||||||
"opmath.cpp"
|
"opmath.cpp"
|
||||||
"util.cpp"
|
"util.cpp"
|
||||||
@@ -67,9 +64,7 @@ set(rgblink_src
|
|||||||
"link/section.cpp"
|
"link/section.cpp"
|
||||||
"link/symbol.cpp"
|
"link/symbol.cpp"
|
||||||
"link/warning.cpp"
|
"link/warning.cpp"
|
||||||
"extern/getopt.cpp"
|
|
||||||
"extern/utf8decoder.cpp"
|
"extern/utf8decoder.cpp"
|
||||||
"error.cpp"
|
|
||||||
"linkdefs.cpp"
|
"linkdefs.cpp"
|
||||||
"opmath.cpp"
|
"opmath.cpp"
|
||||||
"util.cpp"
|
"util.cpp"
|
||||||
@@ -77,8 +72,6 @@ set(rgblink_src
|
|||||||
|
|
||||||
set(rgbfix_src
|
set(rgbfix_src
|
||||||
"fix/main.cpp"
|
"fix/main.cpp"
|
||||||
"extern/getopt.cpp"
|
|
||||||
"error.cpp"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
set(rgbgfx_src
|
set(rgbgfx_src
|
||||||
@@ -91,8 +84,6 @@ set(rgbgfx_src
|
|||||||
"gfx/reverse.cpp"
|
"gfx/reverse.cpp"
|
||||||
"gfx/rgba.cpp"
|
"gfx/rgba.cpp"
|
||||||
"gfx/warning.cpp"
|
"gfx/warning.cpp"
|
||||||
"extern/getopt.cpp"
|
|
||||||
"error.cpp"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
foreach(PROG "asm" "fix" "gfx" "link")
|
foreach(PROG "asm" "fix" "gfx" "link")
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "error.hpp"
|
#include "diagnostics.hpp"
|
||||||
#include "helpers.hpp"
|
#include "helpers.hpp"
|
||||||
#include "linkdefs.hpp"
|
#include "linkdefs.hpp"
|
||||||
#include "platform.hpp" // S_ISDIR (stat macro)
|
#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()) {
|
if (lexer_AtTopLevel()) {
|
||||||
fputs("at top level", stderr);
|
return false;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
assume(!contextStack.empty());
|
||||||
contextStack.top().fileInfo->dump(lexer_GetLineNo());
|
contextStack.top().fileInfo->dump(lexer_GetLineNo());
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<FileStackNode> fstk_GetFileStack() {
|
std::shared_ptr<FileStackNode> fstk_GetFileStack() {
|
||||||
@@ -159,7 +160,7 @@ bool yywrap() {
|
|||||||
uint32_t ifDepth = lexer_GetIFDepth();
|
uint32_t ifDepth = lexer_GetIFDepth();
|
||||||
|
|
||||||
if (ifDepth != 0) {
|
if (ifDepth != 0) {
|
||||||
fatalerror(
|
fatal(
|
||||||
"Ended block with %" PRIu32 " unterminated IF construct%s",
|
"Ended block with %" PRIu32 " unterminated IF construct%s",
|
||||||
ifDepth,
|
ifDepth,
|
||||||
ifDepth == 1 ? "" : "s"
|
ifDepth == 1 ? "" : "s"
|
||||||
@@ -188,7 +189,7 @@ bool yywrap() {
|
|||||||
|
|
||||||
// This error message will refer to the current iteration
|
// This error message will refer to the current iteration
|
||||||
if (sym->type != SYM_VAR) {
|
if (sym->type != SYM_VAR) {
|
||||||
fatalerror("Failed to update FOR symbol value");
|
fatal("Failed to update FOR symbol value");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Advance to the next iteration
|
// Advance to the next iteration
|
||||||
@@ -211,11 +212,11 @@ bool yywrap() {
|
|||||||
|
|
||||||
static void checkRecursionDepth() {
|
static void checkRecursionDepth() {
|
||||||
if (contextStack.size() > maxRecursionDepth) {
|
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();
|
checkRecursionDepth();
|
||||||
|
|
||||||
std::shared_ptr<std::string> uniqueIDStr = nullptr;
|
std::shared_ptr<std::string> uniqueIDStr = nullptr;
|
||||||
@@ -237,7 +238,7 @@ static bool newFileContext(std::string const &filePath, bool updateStateNow) {
|
|||||||
.macroArgs = macroArgs,
|
.macroArgs = macroArgs,
|
||||||
});
|
});
|
||||||
|
|
||||||
return context.lexerState.setFileAsNextState(filePath, updateStateNow);
|
context.lexerState.setFileAsNextState(filePath, updateStateNow);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void newMacroContext(Symbol const ¯o, std::shared_ptr<MacroArgs> macroArgs) {
|
static void newMacroContext(Symbol const ¯o, std::shared_ptr<MacroArgs> macroArgs) {
|
||||||
@@ -322,9 +323,7 @@ void fstk_RunInclude(std::string const &path, bool preInclude) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!newFileContext(*fullPath, false)) {
|
newFileContext(*fullPath, false);
|
||||||
fatalerror("Failed to set up lexer for file include"); // LCOV_EXCL_LINE
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void fstk_RunMacro(std::string const ¯oName, std::shared_ptr<MacroArgs> macroArgs) {
|
void fstk_RunMacro(std::string const ¯oName, std::shared_ptr<MacroArgs> macroArgs) {
|
||||||
@@ -402,15 +401,13 @@ bool fstk_Break() {
|
|||||||
|
|
||||||
void fstk_NewRecursionDepth(size_t newDepth) {
|
void fstk_NewRecursionDepth(size_t newDepth) {
|
||||||
if (contextStack.size() > newDepth + 1) {
|
if (contextStack.size() > newDepth + 1) {
|
||||||
fatalerror("Recursion limit (%zu) exceeded", newDepth);
|
fatal("Recursion limit (%zu) exceeded", newDepth);
|
||||||
}
|
}
|
||||||
maxRecursionDepth = newDepth;
|
maxRecursionDepth = newDepth;
|
||||||
}
|
}
|
||||||
|
|
||||||
void fstk_Init(std::string const &mainPath, size_t maxDepth) {
|
void fstk_Init(std::string const &mainPath, size_t maxDepth) {
|
||||||
if (!newFileContext(mainPath, true)) {
|
newFileContext(mainPath, true);
|
||||||
fatalerror("Failed to open main file");
|
|
||||||
}
|
|
||||||
|
|
||||||
maxRecursionDepth = maxDepth;
|
maxRecursionDepth = maxDepth;
|
||||||
|
|
||||||
|
|||||||
@@ -384,7 +384,7 @@ void lexer_IncIFDepth() {
|
|||||||
|
|
||||||
void lexer_DecIFDepth() {
|
void lexer_DecIFDepth() {
|
||||||
if (lexerState->ifStack.empty()) {
|
if (lexerState->ifStack.empty()) {
|
||||||
fatalerror("Found ENDC outside of an IF construct");
|
fatal("Found ENDC outside of an IF construct");
|
||||||
}
|
}
|
||||||
|
|
||||||
lexerState->ifStack.pop_front();
|
lexerState->ifStack.pop_front();
|
||||||
@@ -410,7 +410,7 @@ void LexerState::setAsCurrentState() {
|
|||||||
lexerState = this;
|
lexerState = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LexerState::setFileAsNextState(std::string const &filePath, bool updateStateNow) {
|
void LexerState::setFileAsNextState(std::string const &filePath, bool updateStateNow) {
|
||||||
if (filePath == "-") {
|
if (filePath == "-") {
|
||||||
path = "<stdin>";
|
path = "<stdin>";
|
||||||
content.emplace<BufferedContent>(STDIN_FILENO);
|
content.emplace<BufferedContent>(STDIN_FILENO);
|
||||||
@@ -423,8 +423,7 @@ bool LexerState::setFileAsNextState(std::string const &filePath, bool updateStat
|
|||||||
struct stat statBuf;
|
struct stat statBuf;
|
||||||
if (stat(filePath.c_str(), &statBuf) != 0) {
|
if (stat(filePath.c_str(), &statBuf) != 0) {
|
||||||
// LCOV_EXCL_START
|
// LCOV_EXCL_START
|
||||||
error("Failed to stat file \"%s\": %s", filePath.c_str(), strerror(errno));
|
fatal("Failed to stat file \"%s\": %s", filePath.c_str(), strerror(errno));
|
||||||
return false;
|
|
||||||
// LCOV_EXCL_STOP
|
// LCOV_EXCL_STOP
|
||||||
}
|
}
|
||||||
path = filePath;
|
path = filePath;
|
||||||
@@ -432,8 +431,7 @@ bool LexerState::setFileAsNextState(std::string const &filePath, bool updateStat
|
|||||||
int fd = open(path.c_str(), O_RDONLY);
|
int fd = open(path.c_str(), O_RDONLY);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
// LCOV_EXCL_START
|
// LCOV_EXCL_START
|
||||||
error("Failed to open file \"%s\": %s", path.c_str(), strerror(errno));
|
fatal("Failed to open file \"%s\": %s", path.c_str(), strerror(errno));
|
||||||
return false;
|
|
||||||
// LCOV_EXCL_STOP
|
// LCOV_EXCL_STOP
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -478,7 +476,6 @@ bool LexerState::setFileAsNextState(std::string const &filePath, bool updateStat
|
|||||||
} else {
|
} else {
|
||||||
lexerStateEOL = this;
|
lexerStateEOL = this;
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LexerState::setViewAsNextState(char const *name, ContentSpan const &span, uint32_t lineNo_) {
|
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) {
|
if (nbReadChars == -1) {
|
||||||
// LCOV_EXCL_START
|
// 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
|
// LCOV_EXCL_STOP
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -600,7 +597,7 @@ static void beginExpansion(std::shared_ptr<std::string> str, std::optional<std::
|
|||||||
|
|
||||||
void lexer_CheckRecursionDepth() {
|
void lexer_CheckRecursionDepth() {
|
||||||
if (lexerState->expansions.size() > maxRecursionDepth + 1) {
|
if (lexerState->expansions.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<std::string> readInterpolation(size_t depth) {
|
static std::shared_ptr<std::string> readInterpolation(size_t depth) {
|
||||||
if (depth > maxRecursionDepth) {
|
if (depth > maxRecursionDepth) {
|
||||||
fatalerror("Recursion limit (%zu) exceeded", maxRecursionDepth);
|
fatal("Recursion limit (%zu) exceeded", maxRecursionDepth);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string fmtBuf;
|
std::string fmtBuf;
|
||||||
@@ -2292,7 +2289,7 @@ static Token skipIfBlock(bool toEndc) {
|
|||||||
case T_(POP_ELIF):
|
case T_(POP_ELIF):
|
||||||
if (lexer_ReachedELSEBlock()) {
|
if (lexer_ReachedELSEBlock()) {
|
||||||
// This should be redundant, as the parser handles this error first.
|
// 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) {
|
if (!toEndc && lexer_GetIFDepth() == startingDepth) {
|
||||||
return token;
|
return token;
|
||||||
@@ -2301,7 +2298,7 @@ static Token skipIfBlock(bool toEndc) {
|
|||||||
|
|
||||||
case T_(POP_ELSE):
|
case T_(POP_ELSE):
|
||||||
if (lexer_ReachedELSEBlock()) {
|
if (lexer_ReachedELSEBlock()) {
|
||||||
fatalerror("Found ELSE after an ELSE block");
|
fatal("Found ELSE after an ELSE block");
|
||||||
}
|
}
|
||||||
lexer_ReachELSEBlock();
|
lexer_ReachELSEBlock();
|
||||||
if (!toEndc && lexer_GetIFDepth() == startingDepth) {
|
if (!toEndc && lexer_GetIFDepth() == startingDepth) {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#include "error.hpp"
|
#include "diagnostics.hpp"
|
||||||
#include "extern/getopt.hpp"
|
#include "extern/getopt.hpp"
|
||||||
#include "helpers.hpp"
|
#include "helpers.hpp"
|
||||||
#include "parser.hpp"
|
#include "parser.hpp"
|
||||||
@@ -164,7 +164,7 @@ int main(int argc, char *argv[]) {
|
|||||||
if (strlen(musl_optarg) == 2) {
|
if (strlen(musl_optarg) == 2) {
|
||||||
opt_B(musl_optarg);
|
opt_B(musl_optarg);
|
||||||
} else {
|
} else {
|
||||||
errx("Must specify exactly 2 characters for option 'b'");
|
fatal("Must specify exactly 2 characters for option 'b'");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -187,7 +187,7 @@ int main(int argc, char *argv[]) {
|
|||||||
if (strlen(musl_optarg) == 4) {
|
if (strlen(musl_optarg) == 4) {
|
||||||
opt_G(musl_optarg);
|
opt_G(musl_optarg);
|
||||||
} else {
|
} else {
|
||||||
errx("Must specify exactly 4 characters for option 'g'");
|
fatal("Must specify exactly 4 characters for option 'g'");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -214,7 +214,7 @@ int main(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
if (dependFile == nullptr) {
|
if (dependFile == nullptr) {
|
||||||
// LCOV_EXCL_START
|
// 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
|
// LCOV_EXCL_STOP
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -232,11 +232,11 @@ int main(int argc, char *argv[]) {
|
|||||||
padByte = strtoul(musl_optarg, &endptr, 0);
|
padByte = strtoul(musl_optarg, &endptr, 0);
|
||||||
|
|
||||||
if (musl_optarg[0] == '\0' || *endptr != '\0') {
|
if (musl_optarg[0] == '\0' || *endptr != '\0') {
|
||||||
errx("Invalid argument for option 'p'");
|
fatal("Invalid argument for option 'p'");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (padByte > 0xFF) {
|
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);
|
opt_P(padByte);
|
||||||
@@ -252,11 +252,11 @@ int main(int argc, char *argv[]) {
|
|||||||
precision = strtoul(precisionArg, &endptr, 0);
|
precision = strtoul(precisionArg, &endptr, 0);
|
||||||
|
|
||||||
if (musl_optarg[0] == '\0' || *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) {
|
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);
|
opt_Q(precision);
|
||||||
@@ -266,7 +266,7 @@ int main(int argc, char *argv[]) {
|
|||||||
maxDepth = strtoul(musl_optarg, &endptr, 0);
|
maxDepth = strtoul(musl_optarg, &endptr, 0);
|
||||||
|
|
||||||
if (musl_optarg[0] == '\0' || *endptr != '\0') {
|
if (musl_optarg[0] == '\0' || *endptr != '\0') {
|
||||||
errx("Invalid argument for option 'r'");
|
fatal("Invalid argument for option 'r'");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -274,7 +274,7 @@ int main(int argc, char *argv[]) {
|
|||||||
// Split "<features>:<name>" so `musl_optarg` is "<features>" and `name` is "<name>"
|
// Split "<features>:<name>" so `musl_optarg` is "<features>" and `name` is "<name>"
|
||||||
char *name = strchr(musl_optarg, ':');
|
char *name = strchr(musl_optarg, ':');
|
||||||
if (!name) {
|
if (!name) {
|
||||||
errx("Invalid argument for option 's'");
|
fatal("Invalid argument for option 's'");
|
||||||
}
|
}
|
||||||
*name++ = '\0';
|
*name++ = '\0';
|
||||||
|
|
||||||
@@ -293,7 +293,7 @@ int main(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
// A feature must be specified
|
// A feature must be specified
|
||||||
if (*feature == '\0') {
|
if (*feature == '\0') {
|
||||||
errx("Empty feature for option 's'");
|
fatal("Empty feature for option 's'");
|
||||||
}
|
}
|
||||||
// Parse the `feature` and update the `features` list
|
// Parse the `feature` and update the `features` list
|
||||||
if (!strcasecmp(feature, "all")) {
|
if (!strcasecmp(feature, "all")) {
|
||||||
@@ -309,7 +309,7 @@ int main(int argc, char *argv[]) {
|
|||||||
: !strcasecmp(feature, "macro") ? STATE_MACRO
|
: !strcasecmp(feature, "macro") ? STATE_MACRO
|
||||||
: NB_STATE_FEATURES;
|
: NB_STATE_FEATURES;
|
||||||
if (value == 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()) {
|
} else if (std::find(RANGE(features), value) != features.end()) {
|
||||||
warnx("Ignoring duplicate feature for option 's': \"%s\"", feature);
|
warnx("Ignoring duplicate feature for option 's': \"%s\"", feature);
|
||||||
} else {
|
} else {
|
||||||
@@ -354,11 +354,11 @@ int main(int argc, char *argv[]) {
|
|||||||
maxValue = strtoul(musl_optarg, &endptr, 0);
|
maxValue = strtoul(musl_optarg, &endptr, 0);
|
||||||
|
|
||||||
if (musl_optarg[0] == '\0' || *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) {
|
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;
|
maxErrors = maxValue;
|
||||||
@@ -416,8 +416,8 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
if (dependFile) {
|
if (dependFile) {
|
||||||
if (targetFileName.empty()) {
|
if (targetFileName.empty()) {
|
||||||
errx("Dependency files can only be created if a target file is specified with either "
|
fatal("Dependency files can only be created if a target file is specified with either "
|
||||||
"-o, -MQ or -MT");
|
"-o, -MQ or -MT");
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(dependFile, "%s: %s\n", targetFileName.c_str(), mainFileName.c_str());
|
fprintf(dependFile, "%s: %s\n", targetFileName.c_str(), mainFileName.c_str());
|
||||||
@@ -444,7 +444,8 @@ int main(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (nbErrors != 0) {
|
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
|
// If parse aborted due to missing an include, and `-MG` was given, exit normally
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "error.hpp"
|
#include "diagnostics.hpp"
|
||||||
#include "helpers.hpp" // assume, Defer
|
#include "helpers.hpp" // assume, Defer
|
||||||
#include "platform.hpp"
|
#include "platform.hpp"
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@ static uint32_t getSectIDIfAny(Section *sect) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Every section that exists should be in `sectionMap`
|
// 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) {
|
static void writePatch(Patch const &patch, FILE *file) {
|
||||||
@@ -326,7 +326,7 @@ void out_WriteObject() {
|
|||||||
}
|
}
|
||||||
if (!file) {
|
if (!file) {
|
||||||
// LCOV_EXCL_START
|
// 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
|
// LCOV_EXCL_STOP
|
||||||
}
|
}
|
||||||
Defer closeFile{[&] { fclose(file); }};
|
Defer closeFile{[&] { fclose(file); }};
|
||||||
@@ -528,7 +528,7 @@ void out_WriteState(std::string name, std::vector<StateFeature> const &features)
|
|||||||
}
|
}
|
||||||
if (!file) {
|
if (!file) {
|
||||||
// LCOV_EXCL_START
|
// 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
|
// LCOV_EXCL_STOP
|
||||||
}
|
}
|
||||||
Defer closeFile{[&] { fclose(file); }};
|
Defer closeFile{[&] { fclose(file); }};
|
||||||
|
|||||||
@@ -488,11 +488,11 @@ if:
|
|||||||
elif:
|
elif:
|
||||||
POP_ELIF iconst NEWLINE {
|
POP_ELIF iconst NEWLINE {
|
||||||
if (lexer_GetIFDepth() == 0) {
|
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_RanIFBlock()) {
|
||||||
if (lexer_ReachedELSEBlock()) {
|
if (lexer_ReachedELSEBlock()) {
|
||||||
fatalerror("Found ELIF after an ELSE block");
|
fatal("Found ELIF after an ELSE block");
|
||||||
}
|
}
|
||||||
lexer_SetMode(LEXER_SKIP_TO_ENDC);
|
lexer_SetMode(LEXER_SKIP_TO_ENDC);
|
||||||
} else if ($2) {
|
} else if ($2) {
|
||||||
@@ -506,11 +506,11 @@ elif:
|
|||||||
else:
|
else:
|
||||||
POP_ELSE NEWLINE {
|
POP_ELSE NEWLINE {
|
||||||
if (lexer_GetIFDepth() == 0) {
|
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_RanIFBlock()) {
|
||||||
if (lexer_ReachedELSEBlock()) {
|
if (lexer_ReachedELSEBlock()) {
|
||||||
fatalerror("Found ELSE after an ELSE block");
|
fatal("Found ELSE after an ELSE block");
|
||||||
}
|
}
|
||||||
lexer_SetMode(LEXER_SKIP_TO_ENDC);
|
lexer_SetMode(LEXER_SKIP_TO_ENDC);
|
||||||
} else {
|
} else {
|
||||||
@@ -779,7 +779,7 @@ endsection:
|
|||||||
|
|
||||||
fail:
|
fail:
|
||||||
POP_FAIL string {
|
POP_FAIL string {
|
||||||
fatalerror("%s", $2.c_str());
|
fatal("%s", $2.c_str());
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
@@ -1608,7 +1608,7 @@ uconst:
|
|||||||
iconst {
|
iconst {
|
||||||
$$ = $1;
|
$$ = $1;
|
||||||
if ($$ < 0) {
|
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) {
|
||||||
if (sym_IsPurgedScoped($3)) {
|
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 {
|
} else {
|
||||||
fatalerror("Unknown symbol \"%s\"", $3.c_str());
|
fatal("Unknown symbol \"%s\"", $3.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Section const *section = sym->getSection();
|
Section const *section = sym->getSection();
|
||||||
|
|
||||||
if (!section) {
|
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,
|
// Section names are capped by rgbasm's maximum string length,
|
||||||
// so this currently can't overflow.
|
// 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) {
|
static void failAssert(AssertionType type) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case ASSERT_FATAL:
|
case ASSERT_FATAL:
|
||||||
fatalerror("Assertion failed");
|
fatal("Assertion failed");
|
||||||
case ASSERT_ERROR:
|
case ASSERT_ERROR:
|
||||||
error("Assertion failed");
|
error("Assertion failed");
|
||||||
break;
|
break;
|
||||||
@@ -3054,7 +3054,7 @@ static void failAssert(AssertionType type) {
|
|||||||
static void failAssertMsg(AssertionType type, std::string const &message) {
|
static void failAssertMsg(AssertionType type, std::string const &message) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case ASSERT_FATAL:
|
case ASSERT_FATAL:
|
||||||
fatalerror("Assertion failed: %s", message.c_str());
|
fatal("Assertion failed: %s", message.c_str());
|
||||||
case ASSERT_ERROR:
|
case ASSERT_ERROR:
|
||||||
error("Assertion failed: %s", message.c_str());
|
error("Assertion failed: %s", message.c_str());
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -434,7 +434,7 @@ void Expression::makeBinaryOp(RPNCommand op, Expression &&src1, Expression const
|
|||||||
break;
|
break;
|
||||||
case RPN_DIV:
|
case RPN_DIV:
|
||||||
if (rval == 0) {
|
if (rval == 0) {
|
||||||
fatalerror("Division by zero");
|
fatal("Division by zero");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lval == INT32_MIN && rval == -1) {
|
if (lval == INT32_MIN && rval == -1) {
|
||||||
@@ -451,7 +451,7 @@ void Expression::makeBinaryOp(RPNCommand op, Expression &&src1, Expression const
|
|||||||
break;
|
break;
|
||||||
case RPN_MOD:
|
case RPN_MOD:
|
||||||
if (rval == 0) {
|
if (rval == 0) {
|
||||||
fatalerror("Modulo by zero");
|
fatal("Modulo by zero");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lval == INT32_MIN && rval == -1) {
|
if (lval == INT32_MIN && rval == -1) {
|
||||||
@@ -462,7 +462,7 @@ void Expression::makeBinaryOp(RPNCommand op, Expression &&src1, Expression const
|
|||||||
break;
|
break;
|
||||||
case RPN_EXP:
|
case RPN_EXP:
|
||||||
if (rval < 0) {
|
if (rval < 0) {
|
||||||
fatalerror("Exponentiation by negative power");
|
fatal("Exponentiation by negative power");
|
||||||
}
|
}
|
||||||
|
|
||||||
data = op_exponent(lval, rval);
|
data = op_exponent(lval, rval);
|
||||||
|
|||||||
@@ -265,7 +265,7 @@ static void mergeSections(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (nbSectErrors) {
|
if (nbSectErrors) {
|
||||||
fatalerror(
|
fatal(
|
||||||
"Cannot create section \"%s\" (%u error%s)",
|
"Cannot create section \"%s\" (%u error%s)",
|
||||||
sect.name.c_str(),
|
sect.name.c_str(),
|
||||||
nbSectErrors,
|
nbSectErrors,
|
||||||
@@ -411,7 +411,7 @@ static Section *getSection(
|
|||||||
// Set the current section
|
// Set the current section
|
||||||
static void changeSection() {
|
static void changeSection() {
|
||||||
if (!currentUnionStack.empty()) {
|
if (!currentUnionStack.empty()) {
|
||||||
fatalerror("Cannot change the section within a UNION");
|
fatal("Cannot change the section within a UNION");
|
||||||
}
|
}
|
||||||
|
|
||||||
sym_ResetCurrentLabelScopes();
|
sym_ResetCurrentLabelScopes();
|
||||||
@@ -448,7 +448,7 @@ void sect_NewSection(
|
|||||||
) {
|
) {
|
||||||
for (SectionStackEntry &entry : sectionStack) {
|
for (SectionStackEntry &entry : sectionStack) {
|
||||||
if (entry.section && entry.section->name == name) {
|
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) {
|
static void growSection(uint32_t growth) {
|
||||||
if (growth > 0 && curOffset > UINT32_MAX - growth) {
|
if (growth > 0 && curOffset > UINT32_MAX - growth) {
|
||||||
fatalerror("Section size would overflow internal counter");
|
fatal("Section size would overflow internal counter");
|
||||||
}
|
}
|
||||||
curOffset += growth;
|
curOffset += growth;
|
||||||
if (uint32_t outOffset = sect_GetOutputOffset(); outOffset > currentSection->size) {
|
if (uint32_t outOffset = sect_GetOutputOffset(); outOffset > currentSection->size) {
|
||||||
@@ -1025,7 +1025,7 @@ void sect_PushSection() {
|
|||||||
|
|
||||||
void sect_PopSection() {
|
void sect_PopSection() {
|
||||||
if (sectionStack.empty()) {
|
if (sectionStack.empty()) {
|
||||||
fatalerror("No entries in the section stack");
|
fatal("No entries in the section stack");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentLoadSection) {
|
if (currentLoadSection) {
|
||||||
@@ -1052,11 +1052,11 @@ void sect_CheckStack() {
|
|||||||
|
|
||||||
void sect_EndSection() {
|
void sect_EndSection() {
|
||||||
if (!currentSection) {
|
if (!currentSection) {
|
||||||
fatalerror("Cannot end the section outside of a SECTION");
|
fatal("Cannot end the section outside of a SECTION");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!currentUnionStack.empty()) {
|
if (!currentUnionStack.empty()) {
|
||||||
fatalerror("Cannot end the section within a UNION");
|
fatal("Cannot end the section within a UNION");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentLoadSection) {
|
if (currentLoadSection) {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
|
|
||||||
#include "error.hpp"
|
#include "diagnostics.hpp"
|
||||||
#include "helpers.hpp" // assume
|
#include "helpers.hpp" // assume
|
||||||
#include "util.hpp"
|
#include "util.hpp"
|
||||||
#include "version.hpp"
|
#include "version.hpp"
|
||||||
@@ -217,12 +217,12 @@ static bool isAutoScoped(std::string const &symName) {
|
|||||||
|
|
||||||
// Check for nothing after the dot
|
// Check for nothing after the dot
|
||||||
if (dotPos == symName.length() - 1) {
|
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
|
// Check for more than one dot
|
||||||
if (symName.find('.', dotPos + 1) != std::string::npos) {
|
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
|
// Check for already-qualified local label
|
||||||
@@ -232,7 +232,7 @@ static bool isAutoScoped(std::string const &symName) {
|
|||||||
|
|
||||||
// Check for unqualifiable local label
|
// Check for unqualifiable local label
|
||||||
if (!globalScope) {
|
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;
|
return true;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "error.hpp"
|
#include "diagnostics.hpp"
|
||||||
#include "helpers.hpp"
|
#include "helpers.hpp"
|
||||||
#include "itertools.hpp"
|
#include "itertools.hpp"
|
||||||
|
|
||||||
@@ -70,9 +70,10 @@ static void printDiag(
|
|||||||
) {
|
) {
|
||||||
fputs(type, stderr);
|
fputs(type, stderr);
|
||||||
fputs(": ", stderr);
|
fputs(": ", stderr);
|
||||||
fstk_DumpCurrent();
|
if (fstk_DumpCurrent()) {
|
||||||
fprintf(stderr, flagfmt, flag);
|
fprintf(stderr, flagfmt, flag);
|
||||||
fputs("\n ", stderr);
|
fputs("\n ", stderr);
|
||||||
|
}
|
||||||
vfprintf(stderr, fmt, args);
|
vfprintf(stderr, fmt, args);
|
||||||
putc('\n', stderr);
|
putc('\n', stderr);
|
||||||
lexer_DumpStringExpansions();
|
lexer_DumpStringExpansions();
|
||||||
@@ -82,12 +83,14 @@ static void incrementErrors() {
|
|||||||
// This intentionally makes 0 act as "unlimited" (or at least "limited to sizeof(unsigned)")
|
// This intentionally makes 0 act as "unlimited" (or at least "limited to sizeof(unsigned)")
|
||||||
nbErrors++;
|
nbErrors++;
|
||||||
if (nbErrors == maxErrors) {
|
if (nbErrors == maxErrors) {
|
||||||
errx(
|
fprintf(
|
||||||
"The maximum of %u error%s was reached (configure with \"-X/--max-errors\"); assembly "
|
stderr,
|
||||||
"aborted!",
|
"Assembly aborted after the maximum of %u error%s! (configure with "
|
||||||
maxErrors,
|
"'-X/--max-errors')\n",
|
||||||
maxErrors == 1 ? "" : "s"
|
nbErrors,
|
||||||
|
nbErrors == 1 ? "" : "s"
|
||||||
);
|
);
|
||||||
|
exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -103,8 +106,9 @@ void error(char const *fmt, ...) {
|
|||||||
|
|
||||||
void error(std::function<void()> callback) {
|
void error(std::function<void()> callback) {
|
||||||
fputs("error: ", stderr);
|
fputs("error: ", stderr);
|
||||||
fstk_DumpCurrent();
|
if (fstk_DumpCurrent()) {
|
||||||
fputs(":\n ", stderr);
|
fputs(":\n ", stderr);
|
||||||
|
}
|
||||||
callback();
|
callback();
|
||||||
putc('\n', stderr);
|
putc('\n', stderr);
|
||||||
lexer_DumpStringExpansions();
|
lexer_DumpStringExpansions();
|
||||||
@@ -113,7 +117,7 @@ void error(std::function<void()> callback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[[noreturn]]
|
[[noreturn]]
|
||||||
void fatalerror(char const *fmt, ...) {
|
void fatal(char const *fmt, ...) {
|
||||||
va_list args;
|
va_list args;
|
||||||
|
|
||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
|
|||||||
@@ -1,5 +1,14 @@
|
|||||||
#include "diagnostics.hpp"
|
#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) {
|
void WarningState::update(WarningState other) {
|
||||||
if (other.state != WARNING_DEFAULT) {
|
if (other.state != WARNING_DEFAULT) {
|
||||||
state = other.state;
|
state = other.state;
|
||||||
|
|||||||
@@ -1,29 +0,0 @@
|
|||||||
// SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
#include "error.hpp"
|
|
||||||
|
|
||||||
#include <errno.h>
|
|
||||||
#include <stdarg.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "error.hpp"
|
#include "diagnostics.hpp"
|
||||||
#include "extern/getopt.hpp"
|
#include "extern/getopt.hpp"
|
||||||
#include "helpers.hpp"
|
#include "helpers.hpp"
|
||||||
#include "platform.hpp"
|
#include "platform.hpp"
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
#include <string_view>
|
#include <string_view>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "error.hpp"
|
#include "diagnostics.hpp"
|
||||||
#include "extern/getopt.hpp"
|
#include "extern/getopt.hpp"
|
||||||
#include "file.hpp"
|
#include "file.hpp"
|
||||||
#include "platform.hpp"
|
#include "platform.hpp"
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
#include <string_view>
|
#include <string_view>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
|
|
||||||
#include "error.hpp"
|
#include "diagnostics.hpp"
|
||||||
#include "helpers.hpp"
|
#include "helpers.hpp"
|
||||||
#include "platform.hpp"
|
#include "platform.hpp"
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "error.hpp"
|
#include "diagnostics.hpp"
|
||||||
#include "file.hpp"
|
#include "file.hpp"
|
||||||
#include "helpers.hpp"
|
#include "helpers.hpp"
|
||||||
#include "itertools.hpp"
|
#include "itertools.hpp"
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "error.hpp"
|
#include "diagnostics.hpp"
|
||||||
#include "file.hpp"
|
#include "file.hpp"
|
||||||
#include "helpers.hpp" // assume
|
#include "helpers.hpp" // assume
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "error.hpp"
|
#include "diagnostics.hpp"
|
||||||
#include "helpers.hpp"
|
#include "helpers.hpp"
|
||||||
#include "itertools.hpp"
|
#include "itertools.hpp"
|
||||||
#include "linkdefs.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 a section failed to go to several places, nothing we can report
|
||||||
if (!section.isBankFixed || !section.isAddressFixed) {
|
if (!section.isBankFixed || !section.isAddressFixed) {
|
||||||
errx(
|
fatal(
|
||||||
"Unable to place \"%s\" (%s section) %s",
|
"Unable to place \"%s\" (%s section) %s",
|
||||||
section.name.c_str(),
|
section.name.c_str(),
|
||||||
sectionTypeInfo[section.type].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
|
// If the section just can't fit the bank, report that
|
||||||
else if (section.org + section.size > endaddr(section.type) + 1) {
|
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 > "
|
"Unable to place \"%s\" (%s section) %s: section runs past end of region ($%04x > "
|
||||||
"$%04x)",
|
"$%04x)",
|
||||||
section.name.c_str(),
|
section.name.c_str(),
|
||||||
@@ -320,7 +320,7 @@ static void placeSection(Section §ion) {
|
|||||||
}
|
}
|
||||||
// Otherwise there is overlap with another section
|
// Otherwise there is overlap with another section
|
||||||
else {
|
else {
|
||||||
errx(
|
fatal(
|
||||||
"Unable to place \"%s\" (%s section) %s: section overlaps with \"%s\"",
|
"Unable to place \"%s\" (%s section) %s: section overlaps with \"%s\"",
|
||||||
section.name.c_str(),
|
section.name.c_str(),
|
||||||
sectionTypeInfo[section.type].name.c_str(),
|
sectionTypeInfo[section.type].name.c_str(),
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "error.hpp"
|
#include "diagnostics.hpp"
|
||||||
#include "extern/getopt.hpp"
|
#include "extern/getopt.hpp"
|
||||||
#include "helpers.hpp" // assume
|
#include "helpers.hpp" // assume
|
||||||
#include "itertools.hpp"
|
#include "itertools.hpp"
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "error.hpp"
|
#include "diagnostics.hpp"
|
||||||
#include "helpers.hpp"
|
#include "helpers.hpp"
|
||||||
#include "linkdefs.hpp"
|
#include "linkdefs.hpp"
|
||||||
#include "platform.hpp"
|
#include "platform.hpp"
|
||||||
@@ -37,7 +37,7 @@ static std::vector<std::vector<FileStackNode>> nodes;
|
|||||||
FILE *tmpFile = file; \
|
FILE *tmpFile = file; \
|
||||||
type tmpVal = func(tmpFile); \
|
type tmpVal = func(tmpFile); \
|
||||||
if (tmpVal == (errval)) { \
|
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<vartype>(tmpVal); \
|
var = static_cast<vartype>(tmpVal); \
|
||||||
} while (0)
|
} while (0)
|
||||||
@@ -78,7 +78,7 @@ static int64_t readLong(FILE *file) {
|
|||||||
std::string &tmpVal = var; \
|
std::string &tmpVal = var; \
|
||||||
for (int tmpByte = getc(tmpFile); tmpByte != '\0'; tmpByte = getc(tmpFile)) { \
|
for (int tmpByte = getc(tmpFile); tmpByte != '\0'; tmpByte = getc(tmpFile)) { \
|
||||||
if (tmpByte == EOF) { \
|
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 { \
|
} else { \
|
||||||
tmpVal.push_back(tmpByte); \
|
tmpVal.push_back(tmpByte); \
|
||||||
} \
|
} \
|
||||||
@@ -136,8 +136,6 @@ static void readFileStackNode(
|
|||||||
}
|
}
|
||||||
if (!node.parent) {
|
if (!node.parent) {
|
||||||
fatal(
|
fatal(
|
||||||
nullptr,
|
|
||||||
0,
|
|
||||||
"%s is not a valid object file: root node (#%" PRIu32 ") may not be REPT",
|
"%s is not a valid object file: root node (#%" PRIu32 ") may not be REPT",
|
||||||
fileName,
|
fileName,
|
||||||
nodeID
|
nodeID
|
||||||
@@ -275,7 +273,7 @@ static void readPatch(
|
|||||||
size_t nbElementsRead = fread(patch.rpnExpression.data(), 1, rpnSize, file);
|
size_t nbElementsRead = fread(patch.rpnExpression.data(), 1, rpnSize, file);
|
||||||
|
|
||||||
if (nbElementsRead != rpnSize) {
|
if (nbElementsRead != rpnSize) {
|
||||||
errx(
|
fatal(
|
||||||
"%s: Cannot read \"%s\"'s patch #%" PRIu32 "'s RPN expression: %s",
|
"%s: Cannot read \"%s\"'s patch #%" PRIu32 "'s RPN expression: %s",
|
||||||
fileName,
|
fileName,
|
||||||
sectName.c_str(),
|
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());
|
tryReadLong(tmp, file, "%s: Cannot read \"%s\"'s' size: %s", fileName, section.name.c_str());
|
||||||
if (tmp < 0 || tmp > UINT16_MAX) {
|
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.size = tmp;
|
||||||
section.offset = 0;
|
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()
|
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) {
|
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 {
|
} else {
|
||||||
section.type = SectionType(type);
|
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());
|
tryReadLong(tmp, file, "%s: Cannot read \"%s\"'s org: %s", fileName, section.name.c_str());
|
||||||
section.isAddressFixed = tmp >= 0;
|
section.isAddressFixed = tmp >= 0;
|
||||||
if (tmp > UINT16_MAX) {
|
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;
|
tmp = UINT16_MAX;
|
||||||
}
|
}
|
||||||
section.org = tmp;
|
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()
|
tmp, file, "%s: Cannot read \"%s\"'s alignment offset: %s", fileName, section.name.c_str()
|
||||||
);
|
);
|
||||||
if (tmp > UINT16_MAX) {
|
if (tmp > UINT16_MAX) {
|
||||||
error(
|
error("\"%s\"'s alignment offset is too large ($%" PRIx32 ")", section.name.c_str(), tmp);
|
||||||
nullptr,
|
|
||||||
0,
|
|
||||||
"\"%s\"'s alignment offset is too large ($%" PRIx32 ")",
|
|
||||||
section.name.c_str(),
|
|
||||||
tmp
|
|
||||||
);
|
|
||||||
tmp = UINT16_MAX;
|
tmp = UINT16_MAX;
|
||||||
}
|
}
|
||||||
section.alignOfs = tmp;
|
section.alignOfs = tmp;
|
||||||
@@ -376,7 +368,7 @@ static void readSection(
|
|||||||
section.data.resize(section.size);
|
section.data.resize(section.size);
|
||||||
if (size_t nbRead = fread(section.data.data(), 1, section.size, file);
|
if (size_t nbRead = fread(section.data.data(), 1, section.size, file);
|
||||||
nbRead != section.size) {
|
nbRead != section.size) {
|
||||||
errx(
|
fatal(
|
||||||
"%s: Cannot read \"%s\"'s data: %s",
|
"%s: Cannot read \"%s\"'s data: %s",
|
||||||
fileName,
|
fileName,
|
||||||
section.name.c_str(),
|
section.name.c_str(),
|
||||||
@@ -446,7 +438,7 @@ void obj_ReadFile(char const *fileName, unsigned int fileID) {
|
|||||||
file = stdin;
|
file = stdin;
|
||||||
}
|
}
|
||||||
if (!file) {
|
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); }};
|
Defer closeFile{[&] { fclose(file); }};
|
||||||
|
|
||||||
@@ -457,7 +449,7 @@ void obj_ReadFile(char const *fileName, unsigned int fileID) {
|
|||||||
ungetc(c, file); // Guaranteed to work
|
ungetc(c, file); // Guaranteed to work
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case EOF:
|
case EOF:
|
||||||
fatal(nullptr, 0, "File \"%s\" is empty!", fileName);
|
fatal("File \"%s\" is empty!", fileName);
|
||||||
|
|
||||||
case 'R':
|
case 'R':
|
||||||
break;
|
break;
|
||||||
@@ -484,7 +476,7 @@ void obj_ReadFile(char const *fileName, unsigned int fileID) {
|
|||||||
|
|
||||||
if (fscanf(file, RGBDS_OBJECT_VERSION_STRING "%n", &matchedElems) == 1
|
if (fscanf(file, RGBDS_OBJECT_VERSION_STRING "%n", &matchedElems) == 1
|
||||||
&& matchedElems != literal_strlen(RGBDS_OBJECT_VERSION_STRING)) {
|
&& 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);
|
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);
|
tryReadLong(revNum, file, "%s: Cannot read revision number: %s", fileName);
|
||||||
if (revNum != RGBDS_OBJECT_REV) {
|
if (revNum != RGBDS_OBJECT_REV) {
|
||||||
errx(
|
fatal(
|
||||||
"%s: Unsupported object file for rgblink %s; try rebuilding \"%s\"%s"
|
"%s: Unsupported object file for rgblink %s; try rebuilding \"%s\"%s"
|
||||||
" (expected revision %d, got %d)",
|
" (expected revision %d, got %d)",
|
||||||
fileName,
|
fileName,
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "error.hpp"
|
#include "diagnostics.hpp"
|
||||||
#include "extern/utf8decoder.hpp"
|
#include "extern/utf8decoder.hpp"
|
||||||
#include "helpers.hpp"
|
#include "helpers.hpp"
|
||||||
#include "linkdefs.hpp"
|
#include "linkdefs.hpp"
|
||||||
@@ -71,7 +71,7 @@ void out_AddSection(Section const §ion) {
|
|||||||
uint32_t minNbBanks = targetBank + 1;
|
uint32_t minNbBanks = targetBank + 1;
|
||||||
|
|
||||||
if (minNbBanks > maxNbBanks[section.type]) {
|
if (minNbBanks > maxNbBanks[section.type]) {
|
||||||
errx(
|
fatal(
|
||||||
"Section \"%s\" has an invalid bank range (%" PRIu32 " > %" PRIu32 ")",
|
"Section \"%s\" has an invalid bank range (%" PRIu32 " > %" PRIu32 ")",
|
||||||
section.name.c_str(),
|
section.name.c_str(),
|
||||||
section.bank,
|
section.bank,
|
||||||
@@ -213,7 +213,7 @@ static void writeROM() {
|
|||||||
outputFile = stdout;
|
outputFile = stdout;
|
||||||
}
|
}
|
||||||
if (!outputFile) {
|
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{[&] {
|
Defer closeOutputFile{[&] {
|
||||||
@@ -231,7 +231,7 @@ static void writeROM() {
|
|||||||
overlayFile = stdin;
|
overlayFile = stdin;
|
||||||
}
|
}
|
||||||
if (!overlayFile) {
|
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{[&] {
|
Defer closeOverlayFile{[&] {
|
||||||
@@ -574,7 +574,7 @@ static void writeSym() {
|
|||||||
symFile = stdout;
|
symFile = stdout;
|
||||||
}
|
}
|
||||||
if (!symFile) {
|
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); }};
|
Defer closeSymFile{[&] { fclose(symFile); }};
|
||||||
|
|
||||||
@@ -625,7 +625,7 @@ static void writeMap() {
|
|||||||
mapFile = stdout;
|
mapFile = stdout;
|
||||||
}
|
}
|
||||||
if (!mapFile) {
|
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); }};
|
Defer closeMapFile{[&] { fclose(mapFile); }};
|
||||||
|
|
||||||
|
|||||||
@@ -150,8 +150,6 @@ optional:
|
|||||||
|
|
||||||
#define scriptError(context, fmt, ...) \
|
#define scriptError(context, fmt, ...) \
|
||||||
::error( \
|
::error( \
|
||||||
nullptr, \
|
|
||||||
0, \
|
|
||||||
"%s(%" PRIu32 "): " fmt, \
|
"%s(%" PRIu32 "): " fmt, \
|
||||||
context.path.c_str(), \
|
context.path.c_str(), \
|
||||||
context.lineNo __VA_OPT__(, ) __VA_ARGS__ \
|
context.lineNo __VA_OPT__(, ) __VA_ARGS__ \
|
||||||
@@ -746,7 +744,7 @@ void script_ProcessScript(char const *path) {
|
|||||||
auto &newContext = lexerStack.emplace_back(std::string(path));
|
auto &newContext = lexerStack.emplace_back(std::string(path));
|
||||||
|
|
||||||
if (!newContext.file.open(newContext.path, std::ios_base::in)) {
|
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();
|
lexerStack.clear();
|
||||||
} else {
|
} else {
|
||||||
yy::parser linkerScriptParser;
|
yy::parser linkerScriptParser;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
#include "error.hpp"
|
#include "diagnostics.hpp"
|
||||||
#include "helpers.hpp"
|
#include "helpers.hpp"
|
||||||
|
|
||||||
#include "link/warning.hpp"
|
#include "link/warning.hpp"
|
||||||
@@ -219,7 +219,7 @@ void sect_AddSection(std::unique_ptr<Section> &§ion) {
|
|||||||
if (Section *target = sect_GetSection(section->name); target) {
|
if (Section *target = sect_GetSection(section->name); target) {
|
||||||
mergeSections(*target, std::move(section));
|
mergeSections(*target, std::move(section));
|
||||||
} else if (section->modifier == SECTION_UNION && sect_HasData(section->type)) {
|
} else if (section->modifier == SECTION_UNION && sect_HasData(section->type)) {
|
||||||
errx(
|
fatal(
|
||||||
"Section \"%s\" is of type %s, which cannot be unionized",
|
"Section \"%s\" is of type %s, which cannot be unionized",
|
||||||
section->name.c_str(),
|
section->name.c_str(),
|
||||||
sectionTypeInfo[section->type].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),
|
// This is trapped early in RGBDS objects (because then the format is not parseable),
|
||||||
// which leaves SDAS objects.
|
// which leaves SDAS objects.
|
||||||
error(
|
error(
|
||||||
nullptr,
|
"Section \"%s\" has not been assigned a type by a linker script", section.name.c_str()
|
||||||
0,
|
|
||||||
"Section \"%s\" has not been assigned a type by a linker script",
|
|
||||||
section.name.c_str()
|
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -253,8 +250,6 @@ static void doSanityChecks(Section §ion) {
|
|||||||
if (is32kMode && section.type == SECTTYPE_ROMX) {
|
if (is32kMode && section.type == SECTTYPE_ROMX) {
|
||||||
if (section.isBankFixed && section.bank != 1) {
|
if (section.isBankFixed && section.bank != 1) {
|
||||||
error(
|
error(
|
||||||
nullptr,
|
|
||||||
0,
|
|
||||||
"Section \"%s\" has type ROMX, which must be in bank 1 (if any) with option `-t`",
|
"Section \"%s\" has type ROMX, which must be in bank 1 (if any) with option `-t`",
|
||||||
section.name.c_str()
|
section.name.c_str()
|
||||||
);
|
);
|
||||||
@@ -265,8 +260,6 @@ static void doSanityChecks(Section §ion) {
|
|||||||
if (isWRAM0Mode && section.type == SECTTYPE_WRAMX) {
|
if (isWRAM0Mode && section.type == SECTTYPE_WRAMX) {
|
||||||
if (section.isBankFixed && section.bank != 1) {
|
if (section.isBankFixed && section.bank != 1) {
|
||||||
error(
|
error(
|
||||||
nullptr,
|
|
||||||
0,
|
|
||||||
"Section \"%s\" has type WRAMX, which must be in bank 1 with options `-w` or `-d`",
|
"Section \"%s\" has type WRAMX, which must be in bank 1 with options `-w` or `-d`",
|
||||||
section.name.c_str()
|
section.name.c_str()
|
||||||
);
|
);
|
||||||
@@ -276,8 +269,6 @@ static void doSanityChecks(Section §ion) {
|
|||||||
}
|
}
|
||||||
if (isDmgMode && section.type == SECTTYPE_VRAM && section.bank == 1) {
|
if (isDmgMode && section.type == SECTTYPE_VRAM && section.bank == 1) {
|
||||||
error(
|
error(
|
||||||
nullptr,
|
|
||||||
0,
|
|
||||||
"Section \"%s\" has type VRAM, which must be in bank 0 with option `-d`",
|
"Section \"%s\" has type VRAM, which must be in bank 0 with option `-d`",
|
||||||
section.name.c_str()
|
section.name.c_str()
|
||||||
);
|
);
|
||||||
@@ -292,8 +283,6 @@ static void doSanityChecks(Section §ion) {
|
|||||||
// Too large an alignment may not be satisfiable
|
// Too large an alignment may not be satisfiable
|
||||||
if (section.isAlignFixed && (section.alignMask & sectionTypeInfo[section.type].startAddr)) {
|
if (section.isAlignFixed && (section.alignMask & sectionTypeInfo[section.type].startAddr)) {
|
||||||
error(
|
error(
|
||||||
nullptr,
|
|
||||||
0,
|
|
||||||
"Section \"%s\" has type %s, which cannot be aligned to $%04x bytes",
|
"Section \"%s\" has type %s, which cannot be aligned to $%04x bytes",
|
||||||
section.name.c_str(),
|
section.name.c_str(),
|
||||||
sectionTypeInfo[section.type].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) {
|
if (section.isBankFixed && section.bank < minbank && section.bank > maxbank) {
|
||||||
error(
|
error(
|
||||||
nullptr,
|
|
||||||
0,
|
|
||||||
minbank == maxbank
|
minbank == maxbank
|
||||||
? "Cannot place section \"%s\" in bank %" PRIu32 ", it must be %" PRIu32
|
? "Cannot place section \"%s\" in bank %" PRIu32 ", it must be %" PRIu32
|
||||||
: "Cannot place section \"%s\" in bank %" PRIu32 ", it must be between %" 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
|
// Check if section has a chance to be placed
|
||||||
if (section.size > sectionTypeInfo[section.type].size) {
|
if (section.size > sectionTypeInfo[section.type].size) {
|
||||||
error(
|
error(
|
||||||
nullptr,
|
|
||||||
0,
|
|
||||||
"Section \"%s\" is bigger than the max size for that type: $%" PRIx16 " > $%" PRIx16,
|
"Section \"%s\" is bigger than the max size for that type: $%" PRIx16 " > $%" PRIx16,
|
||||||
section.name.c_str(),
|
section.name.c_str(),
|
||||||
section.size,
|
section.size,
|
||||||
@@ -343,8 +328,6 @@ static void doSanityChecks(Section §ion) {
|
|||||||
if (section.isAlignFixed) {
|
if (section.isAlignFixed) {
|
||||||
if ((section.org & section.alignMask) != section.alignOfs) {
|
if ((section.org & section.alignMask) != section.alignOfs) {
|
||||||
error(
|
error(
|
||||||
nullptr,
|
|
||||||
0,
|
|
||||||
"Section \"%s\"'s fixed address doesn't match its alignment",
|
"Section \"%s\"'s fixed address doesn't match its alignment",
|
||||||
section.name.c_str()
|
section.name.c_str()
|
||||||
);
|
);
|
||||||
@@ -356,8 +339,6 @@ static void doSanityChecks(Section §ion) {
|
|||||||
if (section.org < sectionTypeInfo[section.type].startAddr
|
if (section.org < sectionTypeInfo[section.type].startAddr
|
||||||
|| section.org > endaddr(section.type)) {
|
|| section.org > endaddr(section.type)) {
|
||||||
error(
|
error(
|
||||||
nullptr,
|
|
||||||
0,
|
|
||||||
"Section \"%s\"'s fixed address $%04" PRIx16 " is outside of range [$%04" PRIx16
|
"Section \"%s\"'s fixed address $%04" PRIx16 " is outside of range [$%04" PRIx16
|
||||||
"; $%04" PRIx16 "]",
|
"; $%04" PRIx16 "]",
|
||||||
section.name.c_str(),
|
section.name.c_str(),
|
||||||
@@ -369,8 +350,6 @@ static void doSanityChecks(Section §ion) {
|
|||||||
|
|
||||||
if (section.org + section.size > endaddr(section.type) + 1) {
|
if (section.org + section.size > endaddr(section.type) + 1) {
|
||||||
error(
|
error(
|
||||||
nullptr,
|
|
||||||
0,
|
|
||||||
"Section \"%s\"'s end address $%04x is greater than last address $%04x",
|
"Section \"%s\"'s end address $%04x is greater than last address $%04x",
|
||||||
section.name.c_str(),
|
section.name.c_str(),
|
||||||
section.org + section.size,
|
section.org + section.size,
|
||||||
|
|||||||
@@ -10,10 +10,9 @@
|
|||||||
static uint32_t nbErrors = 0;
|
static uint32_t nbErrors = 0;
|
||||||
|
|
||||||
static void printDiag(
|
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);
|
fprintf(stderr, "%s: ", type);
|
||||||
fputs(": ", stderr);
|
|
||||||
if (where) {
|
if (where) {
|
||||||
where->dump(lineNo);
|
where->dump(lineNo);
|
||||||
fputs(": ", stderr);
|
fputs(": ", stderr);
|
||||||
@@ -22,22 +21,54 @@ static void printDiag(
|
|||||||
putc('\n', stderr);
|
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, ...) {
|
void warning(FileStackNode const *where, uint32_t lineNo, char const *fmt, ...) {
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, fmt);
|
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);
|
va_end(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
void error(FileStackNode const *where, uint32_t lineNo, char const *fmt, ...) {
|
void error(FileStackNode const *where, uint32_t lineNo, char const *fmt, ...) {
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
printDiag(fmt, args, "error", where, lineNo);
|
printDiag(where, lineNo, fmt, args, "error");
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
||||||
if (nbErrors != UINT32_MAX) {
|
incrementErrors();
|
||||||
nbErrors++;
|
}
|
||||||
}
|
|
||||||
|
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, ...) {
|
void errorNoDump(char const *fmt, ...) {
|
||||||
@@ -47,9 +78,7 @@ void errorNoDump(char const *fmt, ...) {
|
|||||||
vfprintf(stderr, fmt, args);
|
vfprintf(stderr, fmt, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
||||||
if (nbErrors != UINT32_MAX) {
|
incrementErrors();
|
||||||
nbErrors++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void argErr(char flag, char const *fmt, ...) {
|
void argErr(char flag, char const *fmt, ...) {
|
||||||
@@ -60,33 +89,33 @@ void argErr(char flag, char const *fmt, ...) {
|
|||||||
va_end(args);
|
va_end(args);
|
||||||
putc('\n', stderr);
|
putc('\n', stderr);
|
||||||
|
|
||||||
if (nbErrors != UINT32_MAX) {
|
incrementErrors();
|
||||||
nbErrors++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[[noreturn]]
|
[[noreturn]]
|
||||||
void fatal(FileStackNode const *where, uint32_t lineNo, char const *fmt, ...) {
|
void fatal(FileStackNode const *where, uint32_t lineNo, char const *fmt, ...) {
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
printDiag(fmt, args, "FATAL", where, lineNo);
|
printDiag(where, lineNo, fmt, args, "FATAL");
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
||||||
if (nbErrors != UINT32_MAX) {
|
incrementErrors();
|
||||||
nbErrors++;
|
abortLinking(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(
|
[[noreturn]]
|
||||||
stderr, "Linking aborted after %" PRIu32 " error%s\n", nbErrors, nbErrors == 1 ? "" : "s"
|
void fatal(char const *fmt, ...) {
|
||||||
);
|
va_list args;
|
||||||
exit(1);
|
va_start(args, fmt);
|
||||||
|
printDiag(nullptr, 0, fmt, args, "FATAL");
|
||||||
|
va_end(args);
|
||||||
|
|
||||||
|
incrementErrors();
|
||||||
|
abortLinking(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void requireZeroErrors() {
|
void requireZeroErrors() {
|
||||||
if (nbErrors != 0) {
|
if (nbErrors != 0) {
|
||||||
fprintf(
|
abortLinking("failed");
|
||||||
stderr, "Linking failed with %" PRIu32 " error%s\n", nbErrors, nbErrors == 1 ? "" : "s"
|
|
||||||
);
|
|
||||||
exit(1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
error: align-large-ofs.asm(2):
|
error: align-large-ofs.asm(2):
|
||||||
The absolute alignment offset (2) must be less than alignment size (2)
|
The absolute alignment offset (2) must be less than alignment size (2)
|
||||||
error: Assembly aborted (1 error)!
|
Assembly aborted with 1 error!
|
||||||
|
|||||||
@@ -2,4 +2,4 @@ error: align-large.asm(1):
|
|||||||
Alignment must be between 0 and 16, not 17
|
Alignment must be between 0 and 16, not 17
|
||||||
error: align-large.asm(2):
|
error: align-large.asm(2):
|
||||||
Alignment must be between 0 and 16, not 17
|
Alignment must be between 0 and 16, not 17
|
||||||
error: Assembly aborted (2 errors)!
|
Assembly aborted with 2 errors!
|
||||||
|
|||||||
@@ -2,4 +2,4 @@ error: align-offset.asm(4):
|
|||||||
The absolute alignment offset (18) must be less than alignment size (16)
|
The absolute alignment offset (18) must be less than alignment size (16)
|
||||||
error: align-offset.asm(6):
|
error: align-offset.asm(6):
|
||||||
The absolute alignment offset (20) must be less than alignment size (16)
|
The absolute alignment offset (20) must be less than alignment size (16)
|
||||||
error: Assembly aborted (2 errors)!
|
Assembly aborted with 2 errors!
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
error: align-pc-outside-section.asm(1):
|
error: align-pc-outside-section.asm(1):
|
||||||
Cannot output data outside of a SECTION
|
Cannot output data outside of a SECTION
|
||||||
error: Assembly aborted (1 error)!
|
Assembly aborted with 1 error!
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
error: align-unattainable.asm(3):
|
error: align-unattainable.asm(3):
|
||||||
Section "X"'s alignment cannot be attained in WRAM0
|
Section "X"'s alignment cannot be attained in WRAM0
|
||||||
error: Assembly aborted (1 error)!
|
Assembly aborted with 1 error!
|
||||||
|
|||||||
@@ -8,4 +8,4 @@ error: anon-label-bad.asm(10):
|
|||||||
syntax error, unexpected anonymous label, expecting symbol or label or local label
|
syntax error, unexpected anonymous label, expecting symbol or label or local label
|
||||||
error: anon-label-bad.asm(22):
|
error: anon-label-bad.asm(22):
|
||||||
syntax error, unexpected ::
|
syntax error, unexpected ::
|
||||||
error: Assembly aborted (5 errors)!
|
Assembly aborted with 5 errors!
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
error: assert-nosect-bank.asm(1):
|
error: assert-nosect-bank.asm(1):
|
||||||
PC has no bank outside of a section
|
PC has no bank outside of a section
|
||||||
error: Assembly aborted (1 error)!
|
Assembly aborted with 1 error!
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
error: assert@-no-sect.asm(1):
|
error: assert@-no-sect.asm(1):
|
||||||
PC has no value outside of a section
|
PC has no value outside of a section
|
||||||
error: Assembly aborted (1 error)!
|
Assembly aborted with 1 error!
|
||||||
|
|||||||
@@ -20,4 +20,4 @@ error: bank.asm(22) -> bank.asm::def_sect(8):
|
|||||||
Expected constant expression: "Label_u12"'s bank is not known
|
Expected constant expression: "Label_u12"'s bank is not known
|
||||||
error: bank.asm(26):
|
error: bank.asm(26):
|
||||||
BANK argument must be a label
|
BANK argument must be a label
|
||||||
error: Assembly aborted (11 errors)!
|
Assembly aborted with 11 errors!
|
||||||
|
|||||||
@@ -2,4 +2,4 @@ error: block-comment-termination-error.asm(1):
|
|||||||
Unterminated block comment
|
Unterminated block comment
|
||||||
error: block-comment-termination-error.asm(1):
|
error: block-comment-termination-error.asm(1):
|
||||||
syntax error, unexpected end of buffer
|
syntax error, unexpected end of buffer
|
||||||
error: Assembly aborted (2 errors)!
|
Assembly aborted with 2 errors!
|
||||||
|
|||||||
@@ -10,4 +10,4 @@ error: bracketed-macro-args.asm(33) -> bracketed-macro-args.asm::bad(30):
|
|||||||
Macro argument '\<2>' not defined
|
Macro argument '\<2>' not defined
|
||||||
error: bracketed-macro-args.asm(39) -> bracketed-macro-args.asm::toolong(36):
|
error: bracketed-macro-args.asm(39) -> bracketed-macro-args.asm::toolong(36):
|
||||||
Bracketed symbol "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz" does not exist
|
Bracketed symbol "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz" does not exist
|
||||||
error: Assembly aborted (6 errors)!
|
Assembly aborted with 6 errors!
|
||||||
|
|||||||
@@ -4,4 +4,4 @@ error: bracketed-symbols.asm(20):
|
|||||||
"Label" does not have a constant value
|
"Label" does not have a constant value
|
||||||
error: bracketed-symbols.asm(21):
|
error: bracketed-symbols.asm(21):
|
||||||
PC does not have a constant value; the current section is not fixed
|
PC does not have a constant value; the current section is not fixed
|
||||||
error: Assembly aborted (3 errors)!
|
Assembly aborted with 3 errors!
|
||||||
|
|||||||
@@ -54,4 +54,4 @@ error: builtin-overwrite.asm(37) -> builtin-overwrite.asm::tickle(29):
|
|||||||
Built-in symbol '__ISO_8601_UTC__' cannot be redefined
|
Built-in symbol '__ISO_8601_UTC__' cannot be redefined
|
||||||
error: builtin-overwrite.asm(37) -> builtin-overwrite.asm::tickle(30):
|
error: builtin-overwrite.asm(37) -> builtin-overwrite.asm::tickle(30):
|
||||||
Built-in symbol '__ISO_8601_UTC__' cannot be redefined
|
Built-in symbol '__ISO_8601_UTC__' cannot be redefined
|
||||||
error: Assembly aborted (28 errors)!
|
Assembly aborted with 28 errors!
|
||||||
|
|||||||
@@ -30,4 +30,4 @@ error: builtin-reserved.asm(29):
|
|||||||
'.' is reserved for a built-in symbol
|
'.' is reserved for a built-in symbol
|
||||||
error: builtin-reserved.asm(32):
|
error: builtin-reserved.asm(32):
|
||||||
"." has no value outside of a label scope
|
"." has no value outside of a label scope
|
||||||
error: Assembly aborted (16 errors)!
|
Assembly aborted with 16 errors!
|
||||||
|
|||||||
@@ -2,4 +2,4 @@ error: character-escape-at-end.asm(1):
|
|||||||
Illegal character escape at end of input
|
Illegal character escape at end of input
|
||||||
error: character-escape-at-end.asm(1):
|
error: character-escape-at-end.asm(1):
|
||||||
Unterminated string
|
Unterminated string
|
||||||
error: Assembly aborted (2 errors)!
|
Assembly aborted with 2 errors!
|
||||||
|
|||||||
@@ -4,4 +4,4 @@ error: character-escapes.asm(10) -> character-escapes.asm::m(7):
|
|||||||
Invalid character in bracketed macro argument '\'
|
Invalid character in bracketed macro argument '\'
|
||||||
error: character-escapes.asm(10) -> character-escapes.asm::m(8):
|
error: character-escapes.asm(10) -> character-escapes.asm::m(8):
|
||||||
Invalid character in bracketed macro argument '\t'
|
Invalid character in bracketed macro argument '\t'
|
||||||
error: Assembly aborted (3 errors)!
|
Assembly aborted with 3 errors!
|
||||||
|
|||||||
@@ -2,4 +2,4 @@ error: charmap-empty.asm(1):
|
|||||||
Cannot map an empty string
|
Cannot map an empty string
|
||||||
error: charmap-empty.asm(2):
|
error: charmap-empty.asm(2):
|
||||||
syntax error, unexpected end of line
|
syntax error, unexpected end of line
|
||||||
error: Assembly aborted (2 errors)!
|
Assembly aborted with 2 errors!
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
error: charmap-inheritance.asm(26):
|
error: charmap-inheritance.asm(26):
|
||||||
Base charmap 'eggs' doesn't exist
|
Base charmap 'eggs' doesn't exist
|
||||||
error: Assembly aborted (1 error)!
|
Assembly aborted with 1 error!
|
||||||
|
|||||||
@@ -6,4 +6,4 @@ error: charsize.asm(19):
|
|||||||
CHARSIZE: No character mapping for "abcdef"
|
CHARSIZE: No character mapping for "abcdef"
|
||||||
error: charsize.asm(20):
|
error: charsize.asm(20):
|
||||||
CHARSIZE: No character mapping for "é"
|
CHARSIZE: No character mapping for "é"
|
||||||
error: Assembly aborted (4 errors)!
|
Assembly aborted with 4 errors!
|
||||||
|
|||||||
@@ -8,4 +8,4 @@ warning: charval.asm(22): [-Wbuiltin-args]
|
|||||||
CHARVAL: Index starts at 0
|
CHARVAL: Index starts at 0
|
||||||
warning: charval.asm(23): [-Wbuiltin-args]
|
warning: charval.asm(23): [-Wbuiltin-args]
|
||||||
CHARVAL: Index 10 is past the end of the character mapping
|
CHARVAL: Index 10 is past the end of the character mapping
|
||||||
error: Assembly aborted (3 errors)!
|
Assembly aborted with 3 errors!
|
||||||
|
|||||||
@@ -12,4 +12,4 @@ error: code-after-endm-endr-endc.asm(23):
|
|||||||
syntax error, unexpected PRINTLN, expecting end of line
|
syntax error, unexpected PRINTLN, expecting end of line
|
||||||
error: code-after-endm-endr-endc.asm(25):
|
error: code-after-endm-endr-endc.asm(25):
|
||||||
syntax error, unexpected PRINTLN, expecting end of line or end of buffer
|
syntax error, unexpected PRINTLN, expecting end of line or end of buffer
|
||||||
error: Assembly aborted (7 errors)!
|
Assembly aborted with 7 errors!
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
error: command-line-symbols.asm(3):
|
error: command-line-symbols.asm(3):
|
||||||
'FOO' already defined at <command-line>
|
'FOO' already defined at <command-line>
|
||||||
(should it be {interpolated} to define its contents "hello"?)
|
(should it be {interpolated} to define its contents "hello"?)
|
||||||
error: Assembly aborted (1 error)!
|
Assembly aborted with 1 error!
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
error: compound-assignment.asm(35):
|
error: compound-assignment.asm(35):
|
||||||
Expected constant expression: 'UnDeFiNeD' is not constant at assembly time
|
Expected constant expression: 'UnDeFiNeD' is not constant at assembly time
|
||||||
error: Assembly aborted (1 error)!
|
Assembly aborted with 1 error!
|
||||||
|
|||||||
@@ -6,4 +6,4 @@ error: const-and.asm(17):
|
|||||||
Expected constant expression: PC is not constant at assembly time
|
Expected constant expression: PC is not constant at assembly time
|
||||||
error: const-and.asm(20):
|
error: const-and.asm(20):
|
||||||
Expected constant expression: 'Floating' is not constant at assembly time
|
Expected constant expression: 'Floating' is not constant at assembly time
|
||||||
error: Assembly aborted (4 errors)!
|
Assembly aborted with 4 errors!
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
error: const-not.asm(3):
|
error: const-not.asm(3):
|
||||||
Assertion failed
|
Assertion failed
|
||||||
error: Assembly aborted (1 error)!
|
Assembly aborted with 1 error!
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
error: const-zero.asm(21) -> const-zero.asm::test_or(14):
|
error: const-zero.asm(21) -> const-zero.asm::test_or(14):
|
||||||
Expected constant expression: PC is not constant at assembly time
|
Expected constant expression: PC is not constant at assembly time
|
||||||
error: Assembly aborted (1 error)!
|
Assembly aborted with 1 error!
|
||||||
|
|||||||
@@ -2,4 +2,4 @@ error: data-in-ram.asm(2):
|
|||||||
Section 'code' cannot contain code or data (not ROM0 or ROMX)
|
Section 'code' cannot contain code or data (not ROM0 or ROMX)
|
||||||
error: data-in-ram.asm(4):
|
error: data-in-ram.asm(4):
|
||||||
Section 'data' cannot contain code or data (not ROM0 or ROMX)
|
Section 'data' cannot contain code or data (not ROM0 or ROMX)
|
||||||
error: Assembly aborted (2 errors)!
|
Assembly aborted with 2 errors!
|
||||||
|
|||||||
@@ -4,4 +4,4 @@ error: def-scoped.asm(13):
|
|||||||
syntax error, unexpected local label, expecting symbol
|
syntax error, unexpected local label, expecting symbol
|
||||||
error: def-scoped.asm(16):
|
error: def-scoped.asm(16):
|
||||||
syntax error, unexpected local label, expecting symbol
|
syntax error, unexpected local label, expecting symbol
|
||||||
error: Assembly aborted (3 errors)!
|
Assembly aborted with 3 errors!
|
||||||
|
|||||||
@@ -8,4 +8,4 @@ error: def.asm(38):
|
|||||||
error: def.asm(42):
|
error: def.asm(42):
|
||||||
'name' already defined at def.asm(40)
|
'name' already defined at def.asm(40)
|
||||||
(should it be {interpolated} to define its contents "mac2"?)
|
(should it be {interpolated} to define its contents "mac2"?)
|
||||||
error: Assembly aborted (4 errors)!
|
Assembly aborted with 4 errors!
|
||||||
|
|||||||
@@ -2,4 +2,4 @@ error: diff-marks.asm(2):
|
|||||||
syntax error, unexpected - at the beginning of the line (is it a leftover diff mark?)
|
syntax error, unexpected - at the beginning of the line (is it a leftover diff mark?)
|
||||||
error: diff-marks.asm(3):
|
error: diff-marks.asm(3):
|
||||||
syntax error, unexpected + at the beginning of the line (is it a leftover diff mark?)
|
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!
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
error: double-purge.asm(3):
|
error: double-purge.asm(3):
|
||||||
'n' was already purged
|
'n' was already purged
|
||||||
error: Assembly aborted (1 error)!
|
Assembly aborted with 1 error!
|
||||||
|
|||||||
@@ -2,4 +2,4 @@ error: ds-bad.asm(3):
|
|||||||
Expected constant expression: 'unknown' is not constant at assembly time
|
Expected constant expression: 'unknown' is not constant at assembly time
|
||||||
warning: ds-bad.asm(4): [-Wtruncation]
|
warning: ds-bad.asm(4): [-Wtruncation]
|
||||||
Expression must be 8-bit; use LOW() to force 8-bit
|
Expression must be 8-bit; use LOW() to force 8-bit
|
||||||
error: Assembly aborted (1 error)!
|
Assembly aborted with 1 error!
|
||||||
|
|||||||
@@ -2,4 +2,4 @@ error: empty-raw-identifier.asm(5) -> empty-raw-identifier.asm::macro(3):
|
|||||||
Invalid character in bracketed macro argument '?'
|
Invalid character in bracketed macro argument '?'
|
||||||
error: empty-raw-identifier.asm(5) -> empty-raw-identifier.asm::macro(3):
|
error: empty-raw-identifier.asm(5) -> empty-raw-identifier.asm::macro(3):
|
||||||
Empty raw symbol in bracketed macro argument
|
Empty raw symbol in bracketed macro argument
|
||||||
error: Assembly aborted (2 errors)!
|
Assembly aborted with 2 errors!
|
||||||
|
|||||||
@@ -2,4 +2,4 @@ warning: endsection-in-load.asm(3): [-Wunterminated-load]
|
|||||||
`LOAD` block without `ENDL` terminated by `ENDSECTION`
|
`LOAD` block without `ENDL` terminated by `ENDSECTION`
|
||||||
error: endsection-in-load.asm(4):
|
error: endsection-in-load.asm(4):
|
||||||
Found `ENDL` outside of a `LOAD` block
|
Found `ENDL` outside of a `LOAD` block
|
||||||
error: Assembly aborted (1 error)!
|
Assembly aborted with 1 error!
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
error: endsection.asm(4):
|
error: endsection.asm(4):
|
||||||
Cannot output data outside of a SECTION
|
Cannot output data outside of a SECTION
|
||||||
error: Assembly aborted (1 error)!
|
Assembly aborted with 1 error!
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
error: error-limit.asm(2):
|
error: error-limit.asm(2):
|
||||||
'x' already defined at error-limit.asm(1)
|
'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')
|
||||||
|
|||||||
@@ -6,4 +6,4 @@ error: error-recovery.asm(5) -> error-recovery.asm::REPT~2(7):
|
|||||||
syntax error, unexpected symbol
|
syntax error, unexpected symbol
|
||||||
error: error-recovery.asm(5) -> error-recovery.asm::REPT~3(7):
|
error: error-recovery.asm(5) -> error-recovery.asm::REPT~3(7):
|
||||||
syntax error, unexpected symbol
|
syntax error, unexpected symbol
|
||||||
error: Assembly aborted (4 errors)!
|
Assembly aborted with 4 errors!
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
error: expand-empty-string.asm(6) -> expand-empty-string.asm::test(4):
|
error: expand-empty-string.asm(6) -> expand-empty-string.asm::test(4):
|
||||||
syntax error, unexpected number
|
syntax error, unexpected number
|
||||||
error: Assembly aborted (1 error)!
|
Assembly aborted with 1 error!
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
error: export.asm(18):
|
error: export.asm(18):
|
||||||
syntax error, unexpected EQUS
|
syntax error, unexpected EQUS
|
||||||
error: Assembly aborted (1 error)!
|
Assembly aborted with 1 error!
|
||||||
|
|||||||
@@ -4,4 +4,4 @@ error: ff00+c-bad.asm(9):
|
|||||||
Expected constant expression: 'xyz' is not constant at assembly time
|
Expected constant expression: 'xyz' is not constant at assembly time
|
||||||
error: ff00+c-bad.asm(9):
|
error: ff00+c-bad.asm(9):
|
||||||
Base value must be equal to $FF00 for $FF00+C
|
Base value must be equal to $FF00 for $FF00+C
|
||||||
error: Assembly aborted (3 errors)!
|
Assembly aborted with 3 errors!
|
||||||
|
|||||||
@@ -12,4 +12,4 @@ error: fixed-oob.asm(13):
|
|||||||
Section "OAM"'s fixed address $0cab is outside of range [$fe00; $fe9f]
|
Section "OAM"'s fixed address $0cab is outside of range [$fe00; $fe9f]
|
||||||
error: fixed-oob.asm(15):
|
error: fixed-oob.asm(15):
|
||||||
Section "HRAM"'s fixed address $0bad is outside of range [$ff80; $fffe]
|
Section "HRAM"'s fixed address $0bad is outside of range [$ff80; $fffe]
|
||||||
error: Assembly aborted (7 errors)!
|
Assembly aborted with 7 errors!
|
||||||
|
|||||||
@@ -2,4 +2,4 @@ error: fixed-point-precision.asm(22):
|
|||||||
Fixed-point constant precision must be between 1 and 31
|
Fixed-point constant precision must be between 1 and 31
|
||||||
error: fixed-point-precision.asm(23):
|
error: fixed-point-precision.asm(23):
|
||||||
Fixed-point constant precision 0 invalid, defaulting to 16
|
Fixed-point constant precision 0 invalid, defaulting to 16
|
||||||
error: Assembly aborted (2 errors)!
|
Assembly aborted with 2 errors!
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
error: for-loop-variable.asm(12):
|
error: for-loop-variable.asm(12):
|
||||||
'y' already defined as constant at for-loop-variable.asm(8)
|
'y' already defined as constant at for-loop-variable.asm(8)
|
||||||
error: Assembly aborted (1 error)!
|
Assembly aborted with 1 error!
|
||||||
|
|||||||
@@ -2,4 +2,4 @@ error: format-truncation.asm(9):
|
|||||||
Fractional width 260 too long, limiting to 255
|
Fractional width 260 too long, limiting to 255
|
||||||
error: format-truncation.asm(15):
|
error: format-truncation.asm(15):
|
||||||
Fractional width 260 too long, limiting to 255
|
Fractional width 260 too long, limiting to 255
|
||||||
error: Assembly aborted (2 errors)!
|
Assembly aborted with 2 errors!
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
error: fragment-align.asm(25):
|
error: fragment-align.asm(25):
|
||||||
Section is misaligned ($0004 bytes into the section, expected ALIGN[2, 0], got ALIGN[2, 1])
|
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!
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
error: garbage_char.asm(1):
|
error: garbage_char.asm(1):
|
||||||
Unknown character 0xFF
|
Unknown character 0xFF
|
||||||
error: Assembly aborted (1 error)!
|
Assembly aborted with 1 error!
|
||||||
|
|||||||
@@ -8,4 +8,4 @@ error: garbage_sequence.asm(3):
|
|||||||
Unknown character '#'
|
Unknown character '#'
|
||||||
error: garbage_sequence.asm(3):
|
error: garbage_sequence.asm(3):
|
||||||
Unknown characters '#', '?', '?'
|
Unknown characters '#', '?', '?'
|
||||||
error: Assembly aborted (5 errors)!
|
Assembly aborted with 5 errors!
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
error: impossible-bank.asm(1):
|
error: impossible-bank.asm(1):
|
||||||
BANK only allowed for ROMX, WRAMX, SRAM, or VRAM sections
|
BANK only allowed for ROMX, WRAMX, SRAM, or VRAM sections
|
||||||
error: Assembly aborted (1 error)!
|
Assembly aborted with 1 error!
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
error: incbin-empty-bad.asm(3):
|
error: incbin-empty-bad.asm(3):
|
||||||
Specified range in INCBIN file 'empty.bin' is out of bounds (0 + 1 > 0)
|
Specified range in INCBIN file 'empty.bin' is out of bounds (0 + 1 > 0)
|
||||||
error: Assembly aborted (1 error)!
|
Assembly aborted with 1 error!
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
error: incbin-end-0.asm(1):
|
error: incbin-end-0.asm(1):
|
||||||
Cannot output data outside of a SECTION
|
Cannot output data outside of a SECTION
|
||||||
error: Assembly aborted (1 error)!
|
Assembly aborted with 1 error!
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
error: incbin-end-bad.asm(3):
|
error: incbin-end-bad.asm(3):
|
||||||
Specified range in INCBIN file 'data.bin' is out of bounds (123 + 1 > 123)
|
Specified range in INCBIN file 'data.bin' is out of bounds (123 + 1 > 123)
|
||||||
error: Assembly aborted (1 error)!
|
Assembly aborted with 1 error!
|
||||||
|
|||||||
@@ -7,4 +7,4 @@ error: interpolation-overflow.asm(4):
|
|||||||
'\1' cannot be used outside of a macro
|
'\1' cannot be used outside of a macro
|
||||||
error: interpolation-overflow.asm(4):
|
error: interpolation-overflow.asm(4):
|
||||||
syntax error, unexpected number
|
syntax error, unexpected number
|
||||||
error: Assembly aborted (3 errors)!
|
Assembly aborted with 3 errors!
|
||||||
|
|||||||
@@ -6,4 +6,4 @@ error: interpolation.asm(29):
|
|||||||
Interpolated symbol "foo" is not a numeric or string symbol
|
Interpolated symbol "foo" is not a numeric or string symbol
|
||||||
error: interpolation.asm(32):
|
error: interpolation.asm(32):
|
||||||
Interpolated symbol "xor" is a reserved keyword; add a '#' prefix to use it as a raw symbol
|
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!
|
||||||
|
|||||||
@@ -12,4 +12,4 @@ error: invalid-alignment.asm(21):
|
|||||||
Section "e"'s fixed address doesn't match its alignment
|
Section "e"'s fixed address doesn't match its alignment
|
||||||
error: invalid-alignment.asm(23):
|
error: invalid-alignment.asm(23):
|
||||||
Section "f"'s fixed address doesn't match its alignment
|
Section "f"'s fixed address doesn't match its alignment
|
||||||
error: Assembly aborted (7 errors)!
|
Assembly aborted with 7 errors!
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
error: invalid-bank.asm(1):
|
error: invalid-bank.asm(1):
|
||||||
VRAM bank value $0002 out of range ($0000 to $0001)
|
VRAM bank value $0002 out of range ($0000 to $0001)
|
||||||
error: Assembly aborted (1 error)!
|
Assembly aborted with 1 error!
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
error: invalid-empty-macro-arg.asm(1):
|
error: invalid-empty-macro-arg.asm(1):
|
||||||
Empty bracketed macro argument
|
Empty bracketed macro argument
|
||||||
error: Assembly aborted (1 error)!
|
Assembly aborted with 1 error!
|
||||||
|
|||||||
@@ -28,4 +28,4 @@ error: invalid-format.asm(17):
|
|||||||
Formatting type 'd' with fractional width
|
Formatting type 'd' with fractional width
|
||||||
error: invalid-format.asm(18):
|
error: invalid-format.asm(18):
|
||||||
Formatting type 'd' with fractional precision
|
Formatting type 'd' with fractional precision
|
||||||
error: Assembly aborted (15 errors)!
|
Assembly aborted with 15 errors!
|
||||||
|
|||||||
@@ -32,4 +32,4 @@ error: invalid-instructions.asm(20):
|
|||||||
syntax error, unexpected af
|
syntax error, unexpected af
|
||||||
error: invalid-instructions.asm(21):
|
error: invalid-instructions.asm(21):
|
||||||
syntax error, unexpected af
|
syntax error, unexpected af
|
||||||
error: Assembly aborted (16 errors)!
|
Assembly aborted with 16 errors!
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
error: invalid-jr.asm(3):
|
error: invalid-jr.asm(3):
|
||||||
JR target must be between -128 and 127 bytes away, not -258; use JP instead
|
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!
|
||||||
|
|||||||
@@ -2,4 +2,4 @@ error: invalid-macro-arg-character.asm(1):
|
|||||||
Invalid character in bracketed macro argument '!'
|
Invalid character in bracketed macro argument '!'
|
||||||
error: invalid-macro-arg-character.asm(1):
|
error: invalid-macro-arg-character.asm(1):
|
||||||
syntax error, unexpected >
|
syntax error, unexpected >
|
||||||
error: Assembly aborted (2 errors)!
|
Assembly aborted with 2 errors!
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
error: invalid-macro-arg-symbol.asm(1):
|
error: invalid-macro-arg-symbol.asm(1):
|
||||||
Bracketed symbol "foo" does not exist
|
Bracketed symbol "foo" does not exist
|
||||||
error: Assembly aborted (1 error)!
|
Assembly aborted with 1 error!
|
||||||
|
|||||||
@@ -22,4 +22,4 @@ error: invalid-numbers.asm(16):
|
|||||||
Invalid fixed-point constant, no significant digits after 'q'
|
Invalid fixed-point constant, no significant digits after 'q'
|
||||||
error: invalid-numbers.asm(19):
|
error: invalid-numbers.asm(19):
|
||||||
Fixed-point constant precision must be between 1 and 31
|
Fixed-point constant precision must be between 1 and 31
|
||||||
error: Assembly aborted (7 errors)!
|
Assembly aborted with 7 errors!
|
||||||
|
|||||||
@@ -36,4 +36,4 @@ error: invalid-opt.asm(18):
|
|||||||
syntax error, unexpected end of line, expecting string
|
syntax error, unexpected end of line, expecting string
|
||||||
error: invalid-opt.asm(19):
|
error: invalid-opt.asm(19):
|
||||||
No entries in the option stack
|
No entries in the option stack
|
||||||
error: Assembly aborted (19 errors)!
|
Assembly aborted with 19 errors!
|
||||||
|
|||||||
@@ -6,4 +6,4 @@ error: invalid-union.asm(3):
|
|||||||
UNIONs must be inside a SECTION
|
UNIONs must be inside a SECTION
|
||||||
error: invalid-union.asm(7):
|
error: invalid-union.asm(7):
|
||||||
Unterminated UNION construct
|
Unterminated UNION construct
|
||||||
error: Assembly aborted (4 errors)!
|
Assembly aborted with 4 errors!
|
||||||
|
|||||||
@@ -58,4 +58,4 @@ error: invalid-utf-8-strings.asm(54):
|
|||||||
STRSUB: Incomplete UTF-8 character
|
STRSUB: Incomplete UTF-8 character
|
||||||
error: invalid-utf-8-strings.asm(57):
|
error: invalid-utf-8-strings.asm(57):
|
||||||
STRSLICE: Incomplete UTF-8 character
|
STRSLICE: Incomplete UTF-8 character
|
||||||
error: Assembly aborted (30 errors)!
|
Assembly aborted with 30 errors!
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
error: invalid-utf-8.asm(6) -> invalid-utf-8.asm::m(4):
|
error: invalid-utf-8.asm(6) -> invalid-utf-8.asm::m(4):
|
||||||
Unknown characters 0xCF, 0xD3
|
Unknown characters 0xCF, 0xD3
|
||||||
error: Assembly aborted (1 error)!
|
Assembly aborted with 1 error!
|
||||||
|
|||||||
@@ -10,4 +10,4 @@ error: isconst.asm(28) -> isconst.asm::test_expr(9):
|
|||||||
Expected constant expression: 'FloatingLabel' is not constant at assembly time
|
Expected constant expression: 'FloatingLabel' is not constant at assembly time
|
||||||
warning: isconst.asm(29) -> isconst.asm::test_expr(10): [-Wuser]
|
warning: isconst.asm(29) -> isconst.asm::test_expr(10): [-Wuser]
|
||||||
Test #6: Compile-time constant
|
Test #6: Compile-time constant
|
||||||
error: Assembly aborted (2 errors)!
|
Assembly aborted with 2 errors!
|
||||||
|
|||||||
@@ -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
|
Expected constant expression: 'Unknown' is not constant at assembly time
|
||||||
error: label-diff.asm(58) -> label-diff.asm::print_diff(20):
|
error: label-diff.asm(58) -> label-diff.asm::print_diff(20):
|
||||||
Expected constant expression: PC is not constant at assembly time
|
Expected constant expression: PC is not constant at assembly time
|
||||||
error: Assembly aborted (18 errors)!
|
Assembly aborted with 18 errors!
|
||||||
|
|||||||
@@ -14,4 +14,4 @@ error: label-macro-arg.asm(39) -> label-macro-arg.asm::test_char(29):
|
|||||||
Invalid format spec 'sizeof_'
|
Invalid format spec 'sizeof_'
|
||||||
error: label-macro-arg.asm(39) -> label-macro-arg.asm::test_char(29):
|
error: label-macro-arg.asm(39) -> label-macro-arg.asm::test_char(29):
|
||||||
Interpolated symbol "something" does not exist
|
Interpolated symbol "something" does not exist
|
||||||
error: Assembly aborted (7 errors)!
|
Assembly aborted with 7 errors!
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user