Implement -Wnumeric-string[=0|1|2] (#935)

Fixes #934
This commit is contained in:
Rangi
2021-11-12 17:09:35 -05:00
committed by GitHub
parent 55a02981b5
commit 0bb815edc0
14 changed files with 135 additions and 23 deletions

View File

@@ -0,0 +1,25 @@
charmap "<NULL>", $00
SECTION "ROM", ROM0
MACRO try
OPT \1
; no warning
db "A" * 2
db ("<NULL>")
; warn at level 1
dl ("AB<NULL>CD")
dl "<NULL" + ">NULL>"
; warn at level 2
dl (STRCAT("A", "B"))
dl "A<NULL>Z" + 1
ENDM
try Wno-numeric-string
try Wnumeric-string
try Wnumeric-string=0
try Wnumeric-string=1
try Wnumeric-string=2
try Werror=numeric-string=1
try Werror=numeric-string=2