mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Refactor warnings and errors (#1728)
* Remove `err` and `warn`, keep `errx` and `warnx`, using them in RGBGFX too * Separate RGBGFX and RGBLINK warnings/errors from main options * Separate `report` function into `error` and `fatal` messages * Implicit newlines for most RGBASM errors
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#include "link/main.hpp"
|
||||
#include "link/section.hpp"
|
||||
#include "link/symbol.hpp"
|
||||
#include "link/warning.hpp"
|
||||
|
||||
enum NumberType {
|
||||
HEX = 16, // X
|
||||
@@ -307,7 +308,7 @@ void sdobj_ReadFile(FileStackNode const &where, FILE *file, std::vector<Symbol>
|
||||
getToken(nullptr, "'A' line is too short");
|
||||
tmp = parseNumber(where, lineNo, token, numberType);
|
||||
if (tmp & (1 << AREA_PAGING)) {
|
||||
fatal(&where, lineNo, "Internal error: paging is not supported");
|
||||
fatal(&where, lineNo, "Paging is not supported");
|
||||
}
|
||||
curSection->isAddressFixed = tmp & (1 << AREA_ISABS);
|
||||
curSection->isBankFixed = curSection->isAddressFixed;
|
||||
@@ -430,11 +431,8 @@ void sdobj_ReadFile(FileStackNode const &where, FILE *file, std::vector<Symbol>
|
||||
|| (symbolSection && !symbolSection->isAddressFixed)) {
|
||||
sym_AddSymbol(symbol); // This will error out
|
||||
} else if (otherValue != symbolValue) {
|
||||
fprintf(
|
||||
stderr,
|
||||
"error: \"%s\" is defined as %" PRId32 " at ",
|
||||
symbol.name.c_str(),
|
||||
symbolValue
|
||||
errorNoDump(
|
||||
"\"%s\" is defined as %" PRId32 " at ", symbol.name.c_str(), symbolValue
|
||||
);
|
||||
symbol.src->dump(symbol.lineNo);
|
||||
fprintf(stderr, ", but as %" PRId32 " at ", otherValue);
|
||||
|
||||
Reference in New Issue
Block a user