Implement warning diagnostic flags for RGBLINK (#1754)

This commit is contained in:
Rangi
2025-07-17 12:54:29 -04:00
committed by GitHub
parent 529989bde5
commit 5eb093f13e
15 changed files with 332 additions and 55 deletions

View File

@@ -1,4 +1,5 @@
warning: assert.asm(5): Worry about me, but not too much.
warning: assert.asm(5): [-Wassert]
Worry about me, but not too much.
error: assert.asm(6): Okay, this is getting serious!
FATAL: assert.asm(7): It all ends now.
Linking aborted with 2 errors

View File

@@ -1,5 +1,6 @@
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): LDH is deprecated with values from $00 to $FF; use $FF00 to $FFFF
warning: invalid-patches.asm(9): [-Wobsolete]
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(7): Requested STARTOF() of section "NonexistentSection", which was not found
error: invalid-patches.asm(6): Requested BANK() of section "NonexistentSection", which was not found

View File

@@ -0,0 +1,10 @@
def fzero equs "startof(\"test\")"
section "test", rom0
ld a, $8000_0000 / (fzero - 1)
ld a, 1 << (fzero - 1)
ld a, 1 << (fzero + 32)
ld a, (fzero - 1) >> 1
ld a, 1 >> (fzero - 1)
ld a, 1 >> (fzero + 32)
ld a, 1 >>> (fzero - 1)
ld a, 1 >>> (fzero + 32)

View File

@@ -0,0 +1,18 @@
warning: patch-diagnostics.asm(10): [-Wshift-amount]
Shifting right by large amount 32
warning: patch-diagnostics.asm(9): [-Wshift-amount]
Shifting right by negative amount -1
warning: patch-diagnostics.asm(8): [-Wshift-amount]
Shifting right by large amount 32
warning: patch-diagnostics.asm(7): [-Wshift-amount]
Shifting right by negative amount -1
warning: patch-diagnostics.asm(6): [-Wshift]
Shifting right negative value -1
warning: patch-diagnostics.asm(5): [-Wshift-amount]
Shifting left by large amount 32
warning: patch-diagnostics.asm(4): [-Wshift-amount]
Shifting left by negative amount -1
warning: patch-diagnostics.asm(3): [-Wdiv]
Division of -2147483648 by -1 yields -2147483648
warning: patch-diagnostics.asm(3): [-Wtruncation]
Value $80000000 (may be negative?) is not 8-bit

View File

@@ -1,3 +1,4 @@
error: patch-overflow.asm(3): Value 81920 is not 16-bit
error: patch-overflow.asm(2): Value 16384 is not 8-bit
Linking failed with 2 errors
warning: patch-overflow.asm(3): [-Wtruncation]
Value $14000 is not 16-bit
warning: patch-overflow.asm(2): [-Wtruncation]
Value $4000 is not 8-bit

View File

@@ -71,7 +71,7 @@ tryCmpRomSize () {
}
rgblinkQuiet () {
out="$(env $RGBLINK "$@")" || return $?
out="$(env $RGBLINK -Weverything "$@")" || return $?
if [[ -n "$out" ]]; then
echo "$bold${red}Linking shouldn't produce anything on stdout!${rescolors}${resbold}"
false