mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Truncate long format spec strings before using them (#1299)
Fixes #1293
This commit is contained in:
@@ -9,7 +9,7 @@ error: bracketed-macro-args.asm(33) -> bracketed-macro-args.asm::bad(29):
|
||||
error: bracketed-macro-args.asm(33) -> bracketed-macro-args.asm::bad(30):
|
||||
Macro argument '\<2>' not defined
|
||||
warning: bracketed-macro-args.asm(39) -> bracketed-macro-args.asm::toolong(36): [-Wlong-string]
|
||||
Bracketed symbol name too long
|
||||
Bracketed symbol name too long, got truncated
|
||||
error: bracketed-macro-args.asm(39) -> bracketed-macro-args.asm::toolong(36):
|
||||
Bracketed symbol "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstu" does not exist
|
||||
error: Assembly aborted (6 errors)!
|
||||
|
||||
3
test/asm/long-format-spec.asm
Normal file
3
test/asm/long-format-spec.asm
Normal file
@@ -0,0 +1,3 @@
|
||||
DEF n EQU 42
|
||||
; the format spec is truncated to "000...009", omitting the "x", so this prints "000000042" not "00000002a"
|
||||
PRINTLN "{000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009x:n}"
|
||||
5
test/asm/long-format-spec.err
Normal file
5
test/asm/long-format-spec.err
Normal file
@@ -0,0 +1,5 @@
|
||||
warning: long-format-spec.asm(3): [-Wlong-string]
|
||||
Format spec too long, got truncated
|
||||
error: long-format-spec.asm(3):
|
||||
Invalid format spec '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009'
|
||||
error: Assembly aborted (1 error)!
|
||||
1
test/asm/long-format-spec.out
Normal file
1
test/asm/long-format-spec.out
Normal file
@@ -0,0 +1 @@
|
||||
000000042
|
||||
Reference in New Issue
Block a user