mirror of
https://github.com/gbdev/rgbds.git
synced 2026-09-20 20:57:06 +00:00
Warn about signed 8-bit truncation for add sp, e8 and ld hl, sp + e8
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
section "test", rom0
|
||||
|
||||
opt Wtruncation=1
|
||||
|
||||
; good
|
||||
ld hl, sp + 0
|
||||
ld hl, sp + 127
|
||||
ld hl, sp - 128
|
||||
ld hl, sp + -128
|
||||
add sp, 0
|
||||
add sp, 127
|
||||
add sp, -128
|
||||
|
||||
; bad
|
||||
ld hl, sp + 128
|
||||
ld hl, sp - 129
|
||||
ld hl, sp + 255
|
||||
ld hl, sp - 256
|
||||
add sp, 128
|
||||
add sp, -129
|
||||
add sp, 255
|
||||
add sp, -256
|
||||
@@ -0,0 +1,16 @@
|
||||
warning: Expression must be signed 8-bit [-Wtruncation]
|
||||
at sp-signed-truncation.asm(15)
|
||||
warning: Expression must be signed 8-bit [-Wtruncation]
|
||||
at sp-signed-truncation.asm(16)
|
||||
warning: Expression must be signed 8-bit [-Wtruncation]
|
||||
at sp-signed-truncation.asm(17)
|
||||
warning: Expression must be signed 8-bit [-Wtruncation]
|
||||
at sp-signed-truncation.asm(18)
|
||||
warning: Expression must be signed 8-bit [-Wtruncation]
|
||||
at sp-signed-truncation.asm(19)
|
||||
warning: Expression must be signed 8-bit [-Wtruncation]
|
||||
at sp-signed-truncation.asm(20)
|
||||
warning: Expression must be signed 8-bit [-Wtruncation]
|
||||
at sp-signed-truncation.asm(21)
|
||||
warning: Expression must be signed 8-bit [-Wtruncation]
|
||||
at sp-signed-truncation.asm(22)
|
||||
Reference in New Issue
Block a user