Remove previously deprecated features (#1777)

- Treating multi-unit strings as numbers
- `rgbasm -Wnumeric-string`
- `ldio [c], a` and `ldio a, [c]` (use `ldh`)
- `ld [c], a` and `ld a, [c]` (use `ldh`)
- `ldh [$xx], a` and `ldh a, [$xx]` (use `$FFxx`)
This commit is contained in:
Rangi
2025-08-05 16:24:10 -04:00
committed by GitHub
parent a3983b7b0f
commit 39f0f9edc0
30 changed files with 95 additions and 317 deletions

View File

@@ -31,7 +31,7 @@ void act_StaticAssert(AssertionType type, int32_t condition, std::string const &
std::optional<std::string> act_ReadFile(std::string const &name, uint32_t maxLen); std::optional<std::string> act_ReadFile(std::string const &name, uint32_t maxLen);
uint32_t act_CharToNum(std::string const &str); uint32_t act_CharToNum(std::string const &str);
uint32_t act_StringToNum(std::vector<int32_t> const &str); uint32_t act_StringToNum(std::string const &str);
int32_t act_CharVal(std::string const &str); int32_t act_CharVal(std::string const &str);
int32_t act_CharVal(std::string const &str, int32_t negIdx); int32_t act_CharVal(std::string const &str, int32_t negIdx);

View File

@@ -40,7 +40,7 @@ struct Expression {
void makeUnaryOp(RPNCommand op, Expression &&src); void makeUnaryOp(RPNCommand op, Expression &&src);
void makeBinaryOp(RPNCommand op, Expression &&src1, Expression const &src2); void makeBinaryOp(RPNCommand op, Expression &&src1, Expression const &src2);
bool makeCheckHRAM(); void makeCheckHRAM();
void makeCheckRST(); void makeCheckRST();
void makeCheckBitIndex(uint8_t mask); void makeCheckBitIndex(uint8_t mask);

View File

@@ -68,7 +68,7 @@ struct Diagnostics {
} }
WarningBehavior getWarningBehavior(W id) const; WarningBehavior getWarningBehavior(W id) const;
std::string processWarningFlag(char const *flag); void processWarningFlag(char const *flag);
}; };
template<typename L, typename W> template<typename L, typename W>
@@ -121,18 +121,18 @@ WarningBehavior Diagnostics<L, W>::getWarningBehavior(W id) const {
} }
template<typename L, typename W> template<typename L, typename W>
std::string Diagnostics<L, W>::processWarningFlag(char const *flag) { void Diagnostics<L, W>::processWarningFlag(char const *flag) {
std::string rootFlag = flag; std::string rootFlag = flag;
// Check for `-Werror` or `-Wno-error` to return early // Check for `-Werror` or `-Wno-error` to return early
if (rootFlag == "error") { if (rootFlag == "error") {
// `-Werror` promotes warnings to errors // `-Werror` promotes warnings to errors
state.warningsAreErrors = true; state.warningsAreErrors = true;
return rootFlag; return;
} else if (rootFlag == "no-error") { } else if (rootFlag == "no-error") {
// `-Wno-error` disables promotion of warnings to errors // `-Wno-error` disables promotion of warnings to errors
state.warningsAreErrors = false; state.warningsAreErrors = false;
return rootFlag; return;
} }
auto [flagState, param] = getInitialWarningState(rootFlag); auto [flagState, param] = getInitialWarningState(rootFlag);
@@ -174,12 +174,12 @@ std::string Diagnostics<L, W>::processWarningFlag(char const *flag) {
warning.state = WARNING_DISABLED; warning.state = WARNING_DISABLED;
} }
} }
return rootFlag; return;
} }
if (param.has_value()) { if (param.has_value()) {
warnx("Unknown warning flag parameter \"%s=%" PRIu32 "\"", rootFlag.c_str(), *param); warnx("Unknown warning flag parameter \"%s=%" PRIu32 "\"", rootFlag.c_str(), *param);
return rootFlag; return;
} }
// Try to match against a "meta" warning // Try to match against a "meta" warning
@@ -194,19 +194,18 @@ std::string Diagnostics<L, W>::processWarningFlag(char const *flag) {
state.metaStates[id].update(flagState); state.metaStates[id].update(flagState);
} }
} }
return rootFlag; return;
} }
// Try to match against a "normal" flag // Try to match against a "normal" flag
for (W id : EnumSeq(W::NB_PLAIN_WARNINGS)) { for (W id : EnumSeq(W::NB_PLAIN_WARNINGS)) {
if (rootFlag == warningFlags[id].name) { if (rootFlag == warningFlags[id].name) {
state.flagStates[id].update(flagState); state.flagStates[id].update(flagState);
return rootFlag; return;
} }
} }
warnx("Unknown warning flag \"%s\"", rootFlag.c_str()); warnx("Unknown warning flag \"%s\"", rootFlag.c_str());
return rootFlag;
} }
#endif // RGBDS_DIAGNOSTICS_HPP #endif // RGBDS_DIAGNOSTICS_HPP

View File

@@ -130,7 +130,7 @@ Deprecated in 0.5.0, removed in 0.6.0.
Instead, use Instead, use
.Ql 3.141592653 . .Ql 3.141592653 .
.Ss Treating multi-character strings as numbers .Ss Treating multi-character strings as numbers
Deprecated in 0.9.0. Deprecated in 0.9.0, removed in 1.0.0.
.Pp .Pp
Instead, use a multi-value Instead, use a multi-value
.Ic CHARMAP , .Ic CHARMAP ,
@@ -272,12 +272,12 @@ or
and and
.Ql LD A, [HL-] ) . .Ql LD A, [HL-] ) .
.Ss LDIO .Ss LDIO
Deprecated in 0.9.0. Deprecated in 0.9.0, removed in 1.0.0.
.Pp .Pp
Instead, use Instead, use
.Ql LDH . .Ql LDH .
.Ss LD [C], A and LD A, [C] .Ss LD [C], A and LD A, [C]
Deprecated in 0.9.0. Deprecated in 0.9.0, removed in 1.0.0.
.Pp .Pp
Instead, use Instead, use
.Ql LDH [C], A .Ql LDH [C], A
@@ -292,7 +292,7 @@ were also deprecated in 0.9.0, but were
.Em undeprecated .Em undeprecated
in 0.9.1. in 0.9.1.
.Ss LDH [n8], A and LDH A, [n8] .Ss LDH [n8], A and LDH A, [n8]
Deprecated in 0.9.0. Deprecated in 0.9.0, removed in 1.0.0.
.Pp .Pp
.Ql LDH .Ql LDH
used to treat "addresses" from used to treat "addresses" from

View File

@@ -155,39 +155,25 @@ std::optional<std::string> act_ReadFile(std::string const &name, uint32_t maxLen
} }
uint32_t act_CharToNum(std::string const &str) { uint32_t act_CharToNum(std::string const &str) {
if (std::vector<int32_t> output = charmap_Convert(str); output.size() == 1) { if (std::vector<int32_t> units = charmap_Convert(str); units.size() == 1) {
return static_cast<uint32_t>(output[0]); // The string is a single character with a single unit value,
// which can be used directly as a numeric character.
return static_cast<uint32_t>(units[0]);
} else { } else {
error("Character literals must be a single charmap unit"); error("Character literals must be a single charmap unit");
return 0; return 0;
} }
} }
uint32_t act_StringToNum(std::vector<int32_t> const &str) { uint32_t act_StringToNum(std::string const &str) {
uint32_t length = str.size(); if (std::vector<int32_t> units = charmap_Convert(str); units.size() == 1) {
// The string is a single character with a single unit value,
if (length == 1) {
// The string is a single character with a single value,
// which can be used directly as a number. // which can be used directly as a number.
return static_cast<uint32_t>(str[0]); return static_cast<uint32_t>(units[0]);
} else {
error("Strings as numbers must be a single charmap unit");
return 0;
} }
warning(WARNING_OBSOLETE, "Treating multi-unit strings as numbers is deprecated");
for (int32_t v : str) {
if (!checkNBit(v, 8, "All character units")) {
break;
}
}
uint32_t r = 0;
for (uint32_t i = length < 4 ? 0 : length - 4; i < length; ++i) {
r <<= 8;
r |= static_cast<uint8_t>(str[i]);
}
return r;
} }
static uint32_t adjustNegativeIndex(int32_t idx, size_t len, char const *functionName) { static uint32_t adjustNegativeIndex(int32_t idx, size_t len, char const *functionName) {

View File

@@ -69,7 +69,6 @@ static UpperMap<int> const keywordDict{
{"LD", T_(SM83_LD) }, {"LD", T_(SM83_LD) },
{"LDI", T_(SM83_LDI) }, {"LDI", T_(SM83_LDI) },
{"LDD", T_(SM83_LDD) }, {"LDD", T_(SM83_LDD) },
{"LDIO", T_(SM83_LDH) },
{"LDH", T_(SM83_LDH) }, {"LDH", T_(SM83_LDH) },
{"NOP", T_(SM83_NOP) }, {"NOP", T_(SM83_NOP) },
{"OR", T_(SM83_OR) }, {"OR", T_(SM83_OR) },
@@ -251,8 +250,6 @@ static UpperMap<int> const keywordDict{
{"OPT", T_(POP_OPT) }, {"OPT", T_(POP_OPT) },
}; };
static auto ldio = keywordDict.find("LDIO");
static LexerState *lexerState = nullptr; static LexerState *lexerState = nullptr;
static LexerState *lexerStateEOL = nullptr; static LexerState *lexerStateEOL = nullptr;
@@ -1205,9 +1202,6 @@ static Token readIdentifier(char firstChar, bool raw) {
// Attempt to check for a keyword if the identifier is not raw or a local label // Attempt to check for a keyword if the identifier is not raw or a local label
if (!raw && tokenType != T_(LOCAL)) { if (!raw && tokenType != T_(LOCAL)) {
if (auto search = keywordDict.find(identifier); search != keywordDict.end()) { if (auto search = keywordDict.find(identifier); search != keywordDict.end()) {
if (search == ldio) {
warning(WARNING_OBSOLETE, "LDIO is deprecated; use LDH");
}
return Token(search->second); return Token(search->second);
} }
} }

View File

@@ -49,9 +49,7 @@ void opt_R(size_t maxRecursionDepth) {
} }
void opt_W(char const *flag) { void opt_W(char const *flag) {
if (warnings.processWarningFlag(flag) == "numeric-string") { warnings.processWarningFlag(flag);
warning(WARNING_OBSOLETE, "Warning flag \"numeric-string\" is deprecated");
}
} }
void opt_Parse(char const *s) { void opt_Parse(char const *s) {

View File

@@ -1296,17 +1296,15 @@ relocexpr:
$$ = std::move($1); $$ = std::move($1);
} }
| string_literal { | string_literal {
std::vector<int32_t> output = charmap_Convert($1); $$.makeNumber(act_StringToNum($1));
$$.makeNumber(act_StringToNum(output));
} }
| scoped_sym { | scoped_sym {
$$ = handleSymbolByType( $$ = handleSymbolByType(
$1, $1,
[](Expression const &expr) { return expr; }, [](Expression const &expr) { return expr; },
[](std::string const &str) { [](std::string const &str) {
std::vector<int32_t> output = charmap_Convert(str);
Expression expr; Expression expr;
expr.makeNumber(act_StringToNum(output)); expr.makeNumber(act_StringToNum(str));
return expr; return expr;
} }
); );
@@ -2004,26 +2002,22 @@ sm83_ldd:
sm83_ldh: sm83_ldh:
SM83_LDH MODE_A COMMA op_mem_ind { SM83_LDH MODE_A COMMA op_mem_ind {
if ($4.makeCheckHRAM()) { $4.makeCheckHRAM();
warning(
WARNING_OBSOLETE,
"LDH is deprecated with values from $00 to $FF; use $FF00 to $FFFF"
);
}
sect_ConstByte(0xF0); sect_ConstByte(0xF0);
if (!$4.isKnown()) {
sect_RelByte($4, 1); sect_RelByte($4, 1);
} else {
sect_ConstByte($4.value());
}
} }
| SM83_LDH op_mem_ind COMMA MODE_A { | SM83_LDH op_mem_ind COMMA MODE_A {
if ($2.makeCheckHRAM()) { $2.makeCheckHRAM();
warning(
WARNING_OBSOLETE,
"LDH is deprecated with values from $00 to $FF; use $FF00 to $FFFF"
);
}
sect_ConstByte(0xE0); sect_ConstByte(0xE0);
if (!$2.isKnown()) {
sect_RelByte($2, 1); sect_RelByte($2, 1);
} else {
sect_ConstByte($2.value());
}
} }
| SM83_LDH MODE_A COMMA c_ind { | SM83_LDH MODE_A COMMA c_ind {
sect_ConstByte(0xF2); sect_ConstByte(0xF2);
@@ -2108,10 +2102,6 @@ sm83_ld_c_ind:
SM83_LD ff00_c_ind COMMA MODE_A { SM83_LD ff00_c_ind COMMA MODE_A {
sect_ConstByte(0xE2); sect_ConstByte(0xE2);
} }
| SM83_LD c_ind COMMA MODE_A {
warning(WARNING_OBSOLETE, "LD [C], A is deprecated; use LDH [C], A");
sect_ConstByte(0xE2);
}
; ;
sm83_ld_rr: sm83_ld_rr:
@@ -2145,10 +2135,6 @@ sm83_ld_a:
| SM83_LD reg_a COMMA ff00_c_ind { | SM83_LD reg_a COMMA ff00_c_ind {
sect_ConstByte(0xF2); sect_ConstByte(0xF2);
} }
| SM83_LD reg_a COMMA c_ind {
warning(WARNING_OBSOLETE, "LD A, [C] is deprecated; use LDH A, [C]");
sect_ConstByte(0xF2);
}
| SM83_LD reg_a COMMA reg_rr { | SM83_LD reg_a COMMA reg_rr {
sect_ConstByte(0x0A | ($4 << 4)); sect_ConstByte(0x0A | ($4 << 4));
} }

View File

@@ -522,20 +522,16 @@ void Expression::makeBinaryOp(RPNCommand op, Expression &&src1, Expression const
} }
} }
bool Expression::makeCheckHRAM() { void Expression::makeCheckHRAM() {
isSymbol = false; isSymbol = false;
if (!isKnown()) { if (!isKnown()) {
*reserveSpace(1) = RPN_HRAM; *reserveSpace(1) = RPN_HRAM;
} else if (int32_t val = value(); val >= 0xFF00 && val <= 0xFFFF) { } else if (int32_t val = value(); val >= 0xFF00 && val <= 0xFFFF) {
// That range is valid, but only keep the lower byte // That range is valid; only keep the lower byte
data = val & 0xFF; data = val & 0xFF;
} else if (val >= 0 && val <= 0xFF) {
// That range is valid, but deprecated
return true;
} else { } else {
error("Source address $%" PRIx32 " not between $FF00 to $FFFF", val); error("Source address $%" PRIx32 " not between $FF00 to $FFFF", val);
} }
return false;
} }
void Expression::makeCheckRST() { void Expression::makeCheckRST() {

View File

@@ -376,15 +376,9 @@ static int32_t computeRPNExpr(Patch const &patch, std::vector<Symbol> const &fil
case RPN_HRAM: case RPN_HRAM:
value = popRPN(patch); value = popRPN(patch);
if (value < 0 || (value > 0xFF && value < 0xFF00) || value > 0xFFFF) { if (value < 0xFF00 || value > 0xFFFF) {
firstErrorAt(patch, "Address $%" PRIx32 " for LDH is not in HRAM range", value); firstErrorAt(patch, "Address $%" PRIx32 " for LDH is not in HRAM range", value);
value = 0; value = 0;
} else if (value >= 0 && value <= 0xFF) {
warningAt(
patch,
WARNING_OBSOLETE,
"LDH is deprecated with values from $00 to $FF; use $FF00 to $FFFF"
);
} }
value &= 0xFF; value &= 0xFF;
break; break;

View File

@@ -11,7 +11,3 @@ SECTION "Test", ROM0
db "A" + 1 db "A" + 1
dw "A" + 1 dw "A" + 1
dl "A" + 1 dl "A" + 1
db 1, ("WXYZ") & $ff, -1
dw 1, ("WXYZ") & $ffff, -1
dl 1, ("WXYZ"), -1

View File

@@ -1,6 +0,0 @@
warning: db-dw-dl-string.asm(15): [-Wobsolete]
Treating multi-unit strings as numbers is deprecated
warning: db-dw-dl-string.asm(16): [-Wobsolete]
Treating multi-unit strings as numbers is deprecated
warning: db-dw-dl-string.asm(17): [-Wobsolete]
Treating multi-unit strings as numbers is deprecated

Binary file not shown.

View File

@@ -1,31 +0,0 @@
SECTION "LDIO", ROM0
ldh [c], a
ldh a, [c]
ldh [$11], a
ldh a, [$11]
ld [$ff00+c], a
ld a, [$ff00+c]
ld [$ff11], a
ld a, [$ff11]
ldio [c], a
ldio a, [c]
ldio [$ff11], a
ldio a, [$ff11]
LDH [C], A
LDH A, [C]
LDH [$11], A
LDH A, [$11]
LD [$FF00+C], A
LD A, [$FF00+C]
LD [$FF11], A
LD A, [$FF11]
LDIO [C], A
LDIO A, [C]
LDIO [$FF11], A
LDIO A, [$FF11]

View File

@@ -1,24 +0,0 @@
warning: deprecated-ldio.asm(5): [-Wobsolete]
LDH is deprecated with values from $00 to $FF; use $FF00 to $FFFF
warning: deprecated-ldio.asm(6): [-Wobsolete]
LDH is deprecated with values from $00 to $FF; use $FF00 to $FFFF
warning: deprecated-ldio.asm(13): [-Wobsolete]
LDIO is deprecated; use LDH
warning: deprecated-ldio.asm(14): [-Wobsolete]
LDIO is deprecated; use LDH
warning: deprecated-ldio.asm(15): [-Wobsolete]
LDIO is deprecated; use LDH
warning: deprecated-ldio.asm(16): [-Wobsolete]
LDIO is deprecated; use LDH
warning: deprecated-ldio.asm(20): [-Wobsolete]
LDH is deprecated with values from $00 to $FF; use $FF00 to $FFFF
warning: deprecated-ldio.asm(21): [-Wobsolete]
LDH is deprecated with values from $00 to $FF; use $FF00 to $FFFF
warning: deprecated-ldio.asm(28): [-Wobsolete]
LDIO is deprecated; use LDH
warning: deprecated-ldio.asm(29): [-Wobsolete]
LDIO is deprecated; use LDH
warning: deprecated-ldio.asm(30): [-Wobsolete]
LDIO is deprecated; use LDH
warning: deprecated-ldio.asm(31): [-Wobsolete]
LDIO is deprecated; use LDH

View File

@@ -1 +0,0 @@
<EFBFBD><EFBFBD><EFBFBD><11><11><><EFBFBD><11><><11><><EFBFBD><EFBFBD><11><11><><EFBFBD><11><11><><EFBFBD><11><><11><><EFBFBD><EFBFBD><11>

View File

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

3
test/asm/invalid-ldh.asm Normal file
View File

@@ -0,0 +1,3 @@
SECTION "test", ROM0
ldh [$11], a
ldh a, [$22]

5
test/asm/invalid-ldh.err Normal file
View File

@@ -0,0 +1,5 @@
error: invalid-ldh.asm(2):
Source address $11 not between $FF00 to $FFFF
error: invalid-ldh.asm(3):
Source address $22 not between $FF00 to $FFFF
Assembly aborted with 2 errors!

View File

@@ -43,7 +43,7 @@ charmap "ab", $0
new_ map1 new_ map1
print_mapped "ab" print_mapped "ab" ; error
new_ map2, main new_ map2, main
@@ -51,7 +51,7 @@ charmap "ab", $0
set_ map1 set_ map1
print_mapped "ab" print_mapped "ab" ; error
new_ map3 new_ map3
@@ -70,7 +70,7 @@ charmap "cd", $2
set_ map3 set_ map3
print_mapped "ab" print_mapped "ab"
print_mapped "cd" print_mapped "cd" ; error
set_ main set_ main
@@ -92,8 +92,8 @@ charmap "ef", $3
push_set_ map3 push_set_ map3
print_mapped "ab" print_mapped "ab"
print_mapped "cd" print_mapped "cd" ; error
print_mapped "ef" print_mapped "ef" ; error
pop_ pop_
@@ -101,7 +101,7 @@ charmap "ef", $3
pop_ pop_
print_mapped "ab" print_mapped "ab" ; error
new_ map1 new_ map1

View File

@@ -1,21 +1,21 @@
warning: multiple-charmaps.asm(46) -> multiple-charmaps.asm::print_mapped(34): [-Wobsolete] error: multiple-charmaps.asm(46) -> multiple-charmaps.asm::print_mapped(34):
Treating multi-unit strings as numbers is deprecated Strings as numbers must be a single charmap unit
warning: multiple-charmaps.asm(54) -> multiple-charmaps.asm::print_mapped(34): [-Wobsolete] error: multiple-charmaps.asm(54) -> multiple-charmaps.asm::print_mapped(34):
Treating multi-unit strings as numbers is deprecated Strings as numbers must be a single charmap unit
warning: multiple-charmaps.asm(64): [-Wcharmap-redef] warning: multiple-charmaps.asm(64): [-Wcharmap-redef]
Overriding charmap mapping Overriding charmap mapping
warning: multiple-charmaps.asm(73) -> multiple-charmaps.asm::print_mapped(34): [-Wobsolete] error: multiple-charmaps.asm(73) -> multiple-charmaps.asm::print_mapped(34):
Treating multi-unit strings as numbers is deprecated Strings as numbers must be a single charmap unit
warning: multiple-charmaps.asm(95) -> multiple-charmaps.asm::print_mapped(34): [-Wobsolete] error: multiple-charmaps.asm(95) -> multiple-charmaps.asm::print_mapped(34):
Treating multi-unit strings as numbers is deprecated Strings as numbers must be a single charmap unit
warning: multiple-charmaps.asm(96) -> multiple-charmaps.asm::print_mapped(34): [-Wobsolete] error: multiple-charmaps.asm(96) -> multiple-charmaps.asm::print_mapped(34):
Treating multi-unit strings as numbers is deprecated Strings as numbers must be a single charmap unit
warning: multiple-charmaps.asm(104) -> multiple-charmaps.asm::print_mapped(34): [-Wobsolete] error: multiple-charmaps.asm(104) -> multiple-charmaps.asm::print_mapped(34):
Treating multi-unit strings as numbers is deprecated Strings as numbers must be a single charmap unit
error: multiple-charmaps.asm(106) -> multiple-charmaps.asm::new_(9): error: multiple-charmaps.asm(106) -> multiple-charmaps.asm::new_(9):
Charmap 'map1' already exists Charmap 'map1' already exists
error: multiple-charmaps.asm(108) -> multiple-charmaps.asm::set_(15): error: multiple-charmaps.asm(108) -> multiple-charmaps.asm::set_(15):
Charmap 'map5' doesn't exist Charmap 'map5' doesn't exist
error: multiple-charmaps.asm(110) -> multiple-charmaps.asm::pop_(30): error: multiple-charmaps.asm(110) -> multiple-charmaps.asm::pop_(30):
No entries in the charmap stack No entries in the charmap stack
Assembly aborted with 3 errors! Assembly aborted with 9 errors!

View File

@@ -1,11 +1,11 @@
main charmap main charmap
$0 $0
newcharmap map1 newcharmap map1
$6162 $0
newcharmap map2, main newcharmap map2, main
$0 $0
setcharmap map1 setcharmap map1
$6162 $0
newcharmap map3 newcharmap map3
$1 $1
newcharmap map4, map3 newcharmap map4, map3
@@ -13,7 +13,7 @@ $1
$2 $2
setcharmap map3 setcharmap map3
$1 $1
$6364 $0
setcharmap main setcharmap main
$0 $0
modify main charmap modify main charmap
@@ -24,12 +24,12 @@ pushc
setcharmap map2 setcharmap map2
pushc map3 pushc map3
$1 $1
$6364 $0
$6566 $0
popc popc
$0 $0
popc popc
$6162 $0
newcharmap map1 newcharmap map1
setcharmap map5 setcharmap map5
popc popc

View File

@@ -24,12 +24,12 @@ dl "AB" ; dl $01234567, $fedcba98
charmap "C", $01, $23, $45, $67 charmap "C", $01, $23, $45, $67
charmap "D", $fe, $dc, $ba, $98 charmap "D", $fe, $dc, $ba, $98
assert "C" == $01234567 assert CHARVAL("C", 0) == $01 && CHARVAL("C", 3) == $67
assert "D" == $fedcba98 assert CHARVAL("D", 1) == $dc && CHARVAL("D", 2) == $ba
db "CD" ; db $01, $23, $45, $67, $fe, $dc, $ba, $98 db "CD" ; db $01, $23, $45, $67, $fe, $dc, $ba, $98
dw "CD" ; dw $01, $23, $45, $67, $fe, $dc, $ba, $98 dw "CD" ; dw $01, $23, $45, $67, $fe, $dc, $ba, $98
charmap "E", $01, $2345, $6789ab, $cdef charmap "E", $01, $2345, $6789ab, $cdef
assert "E" == $0145abef assert CHARSIZE("E") == 4 && CHARVAL("E", 2) == $6789ab
db "E" ; db $01, $2345, $6789ab, $cdef (truncated to $01, $45, $ab, $ef) db "E" ; db $01, $2345, $6789ab, $cdef (truncated to $01, $45, $ab, $ef)
dl "E" ; dl $01, $2345, $6789ab, $cdef dl "E" ; dl $01, $2345, $6789ab, $cdef

View File

@@ -2,13 +2,5 @@ warning: multivalue-charmap.asm(11): [-Wtruncation]
All character units must be 8-bit All character units must be 8-bit
warning: multivalue-charmap.asm(22): [-Wtruncation] warning: multivalue-charmap.asm(22): [-Wtruncation]
All character units must be 8-bit All character units must be 8-bit
warning: multivalue-charmap.asm(27): [-Wobsolete]
Treating multi-unit strings as numbers is deprecated
warning: multivalue-charmap.asm(28): [-Wobsolete]
Treating multi-unit strings as numbers is deprecated
warning: multivalue-charmap.asm(33): [-Wobsolete]
Treating multi-unit strings as numbers is deprecated
warning: multivalue-charmap.asm(33): [-Wtruncation]
All character units must be 8-bit
warning: multivalue-charmap.asm(34): [-Wtruncation] warning: multivalue-charmap.asm(34): [-Wtruncation]
All character units must be 8-bit All character units must be 8-bit

View File

@@ -6,12 +6,12 @@ error: nested-bad-interpolation.asm(1):
syntax error, unexpected end of line syntax error, unexpected end of line
error: nested-bad-interpolation.asm(2): error: nested-bad-interpolation.asm(2):
Interpolated symbol "b" is a reserved keyword; add a '#' prefix to use it as a raw symbol Interpolated symbol "b" is a reserved keyword; add a '#' prefix to use it as a raw symbol
warning: nested-bad-interpolation.asm(2): [-Wobsolete] error: nested-bad-interpolation.asm(2):
Treating multi-unit strings as numbers is deprecated Strings as numbers must be a single charmap unit
error: nested-bad-interpolation.asm(3): error: nested-bad-interpolation.asm(3):
Interpolated symbol "c" is a reserved keyword; add a '#' prefix to use it as a raw symbol Interpolated symbol "c" is a reserved keyword; add a '#' prefix to use it as a raw symbol
error: nested-bad-interpolation.asm(3): error: nested-bad-interpolation.asm(3):
Interpolated symbol "" does not exist Interpolated symbol "" does not exist
warning: nested-bad-interpolation.asm(3): [-Wobsolete] error: nested-bad-interpolation.asm(3):
Treating multi-unit strings as numbers is deprecated Strings as numbers must be a single charmap unit
Assembly aborted with 6 errors! Assembly aborted with 8 errors!

View File

@@ -4,7 +4,7 @@ macro m
endm endm
assert (#n) == 42 assert (#n) == 42
assert (#s) == $656c6c6f assert (#s) == 0
assert (#m) == 0 assert (#m) == 0
assert (#u) == 0 assert (#u) == 0

View File

@@ -1,5 +1,5 @@
warning: raw-string-symbol-errors.asm(7): [-Wobsolete] error: raw-string-symbol-errors.asm(7):
Treating multi-unit strings as numbers is deprecated Strings as numbers must be a single charmap unit
error: raw-string-symbol-errors.asm(8): error: raw-string-symbol-errors.asm(8):
'm' is not a numeric symbol 'm' is not a numeric symbol
error: raw-string-symbol-errors.asm(11): error: raw-string-symbol-errors.asm(11):
@@ -8,8 +8,8 @@ error: raw-string-symbol-errors.asm(13):
'm' is not a string symbol 'm' is not a string symbol
error: raw-string-symbol-errors.asm(14): error: raw-string-symbol-errors.asm(14):
'u' is not a string symbol 'u' is not a string symbol
warning: raw-string-symbol-errors.asm(17): [-Wobsolete] error: raw-string-symbol-errors.asm(17):
Treating multi-unit strings as numbers is deprecated Strings as numbers must be a single charmap unit
error: raw-string-symbol-errors.asm(18): error: raw-string-symbol-errors.asm(18):
'm' is not a numeric symbol 'm' is not a numeric symbol
error: raw-string-symbol-errors.asm(19): error: raw-string-symbol-errors.asm(19):
@@ -24,4 +24,4 @@ error: raw-string-symbol-errors.asm(27):
's' was already purged 's' was already purged
error: raw-string-symbol-errors.asm(29): error: raw-string-symbol-errors.asm(29):
's' is not a string symbol 's' is not a string symbol
Assembly aborted with 11 errors! Assembly aborted with 13 errors!

View File

@@ -1,25 +0,0 @@
opt Wno-unmapped-char
charmap "<NULL>", $00
SECTION "ROM", ROM0
MACRO try
OPT \1
; no warning
db "A" * 2
db ("<NULL>")
; warn at level 1
dl ("AB<NULL>CD")
dl "<NULL" + ">NULL>"
; warn at level 2
dl (STRCAT("A", "B"))
dl "A<NULL>Z" + 1
ENDM
try Wno-numeric-string
try Wnumeric-string
try Wnumeric-string=0
try Wnumeric-string=1
try Wnumeric-string=2
try Werror=numeric-string=1
try Werror=numeric-string=2

View File

@@ -1,84 +0,0 @@
warning: warn-numeric-string.asm(19) -> warn-numeric-string.asm::try(7): [-Wobsolete]
Warning flag "numeric-string" is deprecated
warning: warn-numeric-string.asm(19) -> warn-numeric-string.asm::try(12): [-Wobsolete]
Treating multi-unit strings as numbers is deprecated
warning: warn-numeric-string.asm(19) -> warn-numeric-string.asm::try(13): [-Wobsolete]
Treating multi-unit strings as numbers is deprecated
warning: warn-numeric-string.asm(19) -> warn-numeric-string.asm::try(13): [-Wobsolete]
Treating multi-unit strings as numbers is deprecated
warning: warn-numeric-string.asm(19) -> warn-numeric-string.asm::try(15): [-Wobsolete]
Treating multi-unit strings as numbers is deprecated
warning: warn-numeric-string.asm(19) -> warn-numeric-string.asm::try(16): [-Wobsolete]
Treating multi-unit strings as numbers is deprecated
warning: warn-numeric-string.asm(20) -> warn-numeric-string.asm::try(7): [-Wobsolete]
Warning flag "numeric-string" is deprecated
warning: warn-numeric-string.asm(20) -> warn-numeric-string.asm::try(12): [-Wobsolete]
Treating multi-unit strings as numbers is deprecated
warning: warn-numeric-string.asm(20) -> warn-numeric-string.asm::try(13): [-Wobsolete]
Treating multi-unit strings as numbers is deprecated
warning: warn-numeric-string.asm(20) -> warn-numeric-string.asm::try(13): [-Wobsolete]
Treating multi-unit strings as numbers is deprecated
warning: warn-numeric-string.asm(20) -> warn-numeric-string.asm::try(15): [-Wobsolete]
Treating multi-unit strings as numbers is deprecated
warning: warn-numeric-string.asm(20) -> warn-numeric-string.asm::try(16): [-Wobsolete]
Treating multi-unit strings as numbers is deprecated
warning: warn-numeric-string.asm(21) -> warn-numeric-string.asm::try(7): [-Wobsolete]
Warning flag "numeric-string" is deprecated
warning: warn-numeric-string.asm(21) -> warn-numeric-string.asm::try(12): [-Wobsolete]
Treating multi-unit strings as numbers is deprecated
warning: warn-numeric-string.asm(21) -> warn-numeric-string.asm::try(13): [-Wobsolete]
Treating multi-unit strings as numbers is deprecated
warning: warn-numeric-string.asm(21) -> warn-numeric-string.asm::try(13): [-Wobsolete]
Treating multi-unit strings as numbers is deprecated
warning: warn-numeric-string.asm(21) -> warn-numeric-string.asm::try(15): [-Wobsolete]
Treating multi-unit strings as numbers is deprecated
warning: warn-numeric-string.asm(21) -> warn-numeric-string.asm::try(16): [-Wobsolete]
Treating multi-unit strings as numbers is deprecated
warning: warn-numeric-string.asm(22) -> warn-numeric-string.asm::try(7): [-Wobsolete]
Warning flag "numeric-string" is deprecated
warning: warn-numeric-string.asm(22) -> warn-numeric-string.asm::try(12): [-Wobsolete]
Treating multi-unit strings as numbers is deprecated
warning: warn-numeric-string.asm(22) -> warn-numeric-string.asm::try(13): [-Wobsolete]
Treating multi-unit strings as numbers is deprecated
warning: warn-numeric-string.asm(22) -> warn-numeric-string.asm::try(13): [-Wobsolete]
Treating multi-unit strings as numbers is deprecated
warning: warn-numeric-string.asm(22) -> warn-numeric-string.asm::try(15): [-Wobsolete]
Treating multi-unit strings as numbers is deprecated
warning: warn-numeric-string.asm(22) -> warn-numeric-string.asm::try(16): [-Wobsolete]
Treating multi-unit strings as numbers is deprecated
warning: warn-numeric-string.asm(23) -> warn-numeric-string.asm::try(7): [-Wobsolete]
Warning flag "numeric-string" is deprecated
warning: warn-numeric-string.asm(23) -> warn-numeric-string.asm::try(12): [-Wobsolete]
Treating multi-unit strings as numbers is deprecated
warning: warn-numeric-string.asm(23) -> warn-numeric-string.asm::try(13): [-Wobsolete]
Treating multi-unit strings as numbers is deprecated
warning: warn-numeric-string.asm(23) -> warn-numeric-string.asm::try(13): [-Wobsolete]
Treating multi-unit strings as numbers is deprecated
warning: warn-numeric-string.asm(23) -> warn-numeric-string.asm::try(15): [-Wobsolete]
Treating multi-unit strings as numbers is deprecated
warning: warn-numeric-string.asm(23) -> warn-numeric-string.asm::try(16): [-Wobsolete]
Treating multi-unit strings as numbers is deprecated
warning: warn-numeric-string.asm(24) -> warn-numeric-string.asm::try(7): [-Wobsolete]
Warning flag "numeric-string" is deprecated
warning: warn-numeric-string.asm(24) -> warn-numeric-string.asm::try(12): [-Wobsolete]
Treating multi-unit strings as numbers is deprecated
warning: warn-numeric-string.asm(24) -> warn-numeric-string.asm::try(13): [-Wobsolete]
Treating multi-unit strings as numbers is deprecated
warning: warn-numeric-string.asm(24) -> warn-numeric-string.asm::try(13): [-Wobsolete]
Treating multi-unit strings as numbers is deprecated
warning: warn-numeric-string.asm(24) -> warn-numeric-string.asm::try(15): [-Wobsolete]
Treating multi-unit strings as numbers is deprecated
warning: warn-numeric-string.asm(24) -> warn-numeric-string.asm::try(16): [-Wobsolete]
Treating multi-unit strings as numbers is deprecated
warning: warn-numeric-string.asm(25) -> warn-numeric-string.asm::try(7): [-Wobsolete]
Warning flag "numeric-string" is deprecated
warning: warn-numeric-string.asm(25) -> warn-numeric-string.asm::try(12): [-Wobsolete]
Treating multi-unit strings as numbers is deprecated
warning: warn-numeric-string.asm(25) -> warn-numeric-string.asm::try(13): [-Wobsolete]
Treating multi-unit strings as numbers is deprecated
warning: warn-numeric-string.asm(25) -> warn-numeric-string.asm::try(13): [-Wobsolete]
Treating multi-unit strings as numbers is deprecated
warning: warn-numeric-string.asm(25) -> warn-numeric-string.asm::try(15): [-Wobsolete]
Treating multi-unit strings as numbers is deprecated
warning: warn-numeric-string.asm(25) -> warn-numeric-string.asm::try(16): [-Wobsolete]
Treating multi-unit strings as numbers is deprecated

View File

@@ -1,10 +1,9 @@
error: invalid-patches.asm(10): JR target must be between -128 and 127 bytes away, not 190; use JP instead error: invalid-patches.asm(10): JR target must be between -128 and 127 bytes away, not 190; use JP instead
warning: invalid-patches.asm(9): [-Wobsolete] error: invalid-patches.asm(9): Address $0 for LDH is not in HRAM range
LDH is deprecated with values from $00 to $FF; use $FF00 to $FFFF
error: invalid-patches.asm(8): Requested SIZEOF() of section "NonexistentSection", which was not found error: invalid-patches.asm(8): Requested SIZEOF() of section "NonexistentSection", which was not found
error: invalid-patches.asm(7): Requested STARTOF() of section "NonexistentSection", which was not found error: invalid-patches.asm(7): Requested STARTOF() of section "NonexistentSection", which was not found
error: invalid-patches.asm(6): Requested BANK() of section "NonexistentSection", which was not found error: invalid-patches.asm(6): Requested BANK() of section "NonexistentSection", which was not found
error: invalid-patches.asm(5): Requested BANK() of symbol "NonexistentSymbol", which was not found error: invalid-patches.asm(5): Requested BANK() of symbol "NonexistentSymbol", which was not found
error: invalid-patches.asm(4): Exponent by negative value -1 error: invalid-patches.asm(4): Exponent by negative value -1
error: invalid-patches.asm(3): Modulo by 0 error: invalid-patches.asm(3): Modulo by 0
Linking failed with 7 errors Linking failed with 8 errors