mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
-Wmacro-shift warns about shifting macro arguments too far (#741)
Fixes #735
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
warning: narg-decreases-after-shift.asm(14) -> narg-decreases-after-shift.asm::testing(9): [-Wmacro-shift]
|
||||
Cannot shift macro arguments past their end
|
||||
|
||||
@@ -8,9 +8,7 @@ m: macro
|
||||
; Shifting a little more to check that over-shifting doesn't crash
|
||||
SHIFT
|
||||
SHIFT
|
||||
REPT 256
|
||||
SHIFT
|
||||
ENDR
|
||||
SHIFT 256
|
||||
PRINTLN "\1"
|
||||
endm
|
||||
|
||||
|
||||
@@ -1,2 +1,6 @@
|
||||
FATAL: rept-shift.asm(17) -> rept-shift.asm::m(14):
|
||||
warning: rept-shift.asm(15) -> rept-shift.asm::m(10): [-Wmacro-shift]
|
||||
Cannot shift macro arguments past their end
|
||||
warning: rept-shift.asm(15) -> rept-shift.asm::m(11): [-Wmacro-shift]
|
||||
Cannot shift macro arguments past their end
|
||||
FATAL: rept-shift.asm(15) -> rept-shift.asm::m(12):
|
||||
Macro argument '\1' not defined
|
||||
|
||||
@@ -12,5 +12,9 @@ ENDM
|
||||
m: MACRO
|
||||
shift 2
|
||||
shift -3
|
||||
shift 1
|
||||
shift 1
|
||||
shift -1
|
||||
shift -1
|
||||
ENDM
|
||||
m
|
||||
m one
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
warning: shift-negative.asm(20) -> shift-negative.asm::m(13): [-Wmacro-shift]
|
||||
Cannot shift macro arguments past their end
|
||||
warning: shift-negative.asm(20) -> shift-negative.asm::m(14): [-Wmacro-shift]
|
||||
Cannot shift macro arguments past their beginning
|
||||
warning: shift-negative.asm(20) -> shift-negative.asm::m(16): [-Wmacro-shift]
|
||||
Cannot shift macro arguments past their end
|
||||
warning: shift-negative.asm(20) -> shift-negative.asm::m(18): [-Wmacro-shift]
|
||||
Cannot shift macro arguments past their beginning
|
||||
|
||||
Reference in New Issue
Block a user