mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Add a -Wunmapped-char warning for characters not in the charmap (#1023)
Fixes #1022
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
opt Wno-unmapped-char
|
||||
charmap "<NULL>", $00
|
||||
charmap "A", $10
|
||||
charmap "B", $20
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
opt Wno-unmapped-char
|
||||
|
||||
new_: MACRO
|
||||
IF _NARG > 1
|
||||
println "newcharmap \1, \2"
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
warning: multiple-charmaps.asm(39) -> multiple-charmaps.asm::print_mapped(27): [-Wnumeric-string]
|
||||
warning: multiple-charmaps.asm(41) -> multiple-charmaps.asm::print_mapped(29): [-Wnumeric-string]
|
||||
Treating 2-character string as a number
|
||||
warning: multiple-charmaps.asm(47) -> multiple-charmaps.asm::print_mapped(27): [-Wnumeric-string]
|
||||
warning: multiple-charmaps.asm(49) -> multiple-charmaps.asm::print_mapped(29): [-Wnumeric-string]
|
||||
Treating 2-character string as a number
|
||||
warning: multiple-charmaps.asm(66) -> multiple-charmaps.asm::print_mapped(27): [-Wnumeric-string]
|
||||
warning: multiple-charmaps.asm(68) -> multiple-charmaps.asm::print_mapped(29): [-Wnumeric-string]
|
||||
Treating 2-character string as a number
|
||||
warning: multiple-charmaps.asm(89) -> multiple-charmaps.asm::print_mapped(27): [-Wnumeric-string]
|
||||
warning: multiple-charmaps.asm(91) -> multiple-charmaps.asm::print_mapped(29): [-Wnumeric-string]
|
||||
Treating 2-character string as a number
|
||||
warning: multiple-charmaps.asm(90) -> multiple-charmaps.asm::print_mapped(27): [-Wnumeric-string]
|
||||
warning: multiple-charmaps.asm(92) -> multiple-charmaps.asm::print_mapped(29): [-Wnumeric-string]
|
||||
Treating 2-character string as a number
|
||||
warning: multiple-charmaps.asm(98) -> multiple-charmaps.asm::print_mapped(27): [-Wnumeric-string]
|
||||
warning: multiple-charmaps.asm(100) -> multiple-charmaps.asm::print_mapped(29): [-Wnumeric-string]
|
||||
Treating 2-character string as a number
|
||||
error: multiple-charmaps.asm(100) -> multiple-charmaps.asm::new_(7):
|
||||
error: multiple-charmaps.asm(102) -> multiple-charmaps.asm::new_(9):
|
||||
Charmap 'map1' already exists
|
||||
error: multiple-charmaps.asm(102) -> multiple-charmaps.asm::set_(13):
|
||||
error: multiple-charmaps.asm(104) -> multiple-charmaps.asm::set_(15):
|
||||
Charmap 'map5' doesn't exist
|
||||
error: multiple-charmaps.asm(104) -> multiple-charmaps.asm::pop_(23):
|
||||
error: multiple-charmaps.asm(106) -> multiple-charmaps.asm::pop_(25):
|
||||
No entries in the charmap stack
|
||||
error: Assembly aborted (3 errors)!
|
||||
|
||||
18
test/asm/unmapped-char.asm
Normal file
18
test/asm/unmapped-char.asm
Normal file
@@ -0,0 +1,18 @@
|
||||
SECTION "test", ROM0
|
||||
|
||||
db "A" ; OK, default empty charmap
|
||||
|
||||
pushc
|
||||
newcharmap custom
|
||||
db "A" ; unmapped in non-default charmap
|
||||
popc
|
||||
|
||||
db "A" ; OK, default empty charmap again
|
||||
|
||||
charmap "B", $42
|
||||
db "A" ; unmapped in non-empty charmap
|
||||
|
||||
println "A" ; does not use charmap
|
||||
|
||||
opt Wno-unmapped-char
|
||||
db "A" ; warning silenced
|
||||
4
test/asm/unmapped-char.err
Normal file
4
test/asm/unmapped-char.err
Normal file
@@ -0,0 +1,4 @@
|
||||
warning: unmapped-char.asm(7): [-Wunmapped-char]
|
||||
Unmapped character 'A'
|
||||
warning: unmapped-char.asm(13): [-Wunmapped-char]
|
||||
Unmapped character 'A'
|
||||
1
test/asm/unmapped-char.out
Normal file
1
test/asm/unmapped-char.out
Normal file
@@ -0,0 +1 @@
|
||||
A
|
||||
1
test/asm/unmapped-char.out.bin
Normal file
1
test/asm/unmapped-char.out.bin
Normal file
@@ -0,0 +1 @@
|
||||
AAAAA
|
||||
@@ -1,6 +1,6 @@
|
||||
opt Wno-unmapped-char
|
||||
charmap "<NULL>", $00
|
||||
|
||||
|
||||
SECTION "ROM", ROM0
|
||||
|
||||
MACRO try
|
||||
|
||||
Reference in New Issue
Block a user