mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Add -Wobsolete to RGBFIX and RGBGFX, and deprecate rgbfix -O
This commit is contained in:
@@ -145,6 +145,7 @@ _rgbfix_completions() {
|
||||
warning)
|
||||
mapfile -t COMPREPLY < <(compgen -W "
|
||||
mbc
|
||||
obsolete
|
||||
overwrite
|
||||
sgb
|
||||
truncation
|
||||
|
||||
@@ -157,6 +157,7 @@ _rgbgfx_completions() {
|
||||
warning)
|
||||
mapfile -t COMPREPLY < <(compgen -W "
|
||||
embedded
|
||||
obsolete
|
||||
trim-nonempty
|
||||
all
|
||||
everything
|
||||
|
||||
@@ -42,6 +42,7 @@ _rgbfix_warnings() {
|
||||
'everything:Enable literally everything'
|
||||
|
||||
'mbc:Warn about issues with MBC specs'
|
||||
'obsolete:Warn when using deprecated features'
|
||||
'overwrite:Warn when overwriting non-zero bytes'
|
||||
'sgb:Warn when SGB flag conflicts with old licensee code'
|
||||
'truncation:Warn when values are truncated to fit'
|
||||
|
||||
@@ -17,6 +17,7 @@ _rgbgfx_warnings() {
|
||||
'everything:Enable literally everything'
|
||||
|
||||
'embedded:Warn when using embedded PLTE without "-c embedded"'
|
||||
'obsolete:Warn when using deprecated features'
|
||||
'trim-nonempty:Warn when "-x" trims nonempty tiles'
|
||||
)
|
||||
_describe warning warnings
|
||||
|
||||
@@ -13,6 +13,7 @@ enum WarningLevel {
|
||||
|
||||
enum WarningID {
|
||||
WARNING_MBC, // Issues with MBC specs
|
||||
WARNING_OBSOLETE, // Obsolete/deprecated things
|
||||
WARNING_OVERWRITE, // Overwriting non-zero bytes
|
||||
WARNING_SGB, // SGB flag conflicts with old licensee code
|
||||
WARNING_TRUNCATION, // Truncating values to fit
|
||||
|
||||
@@ -13,6 +13,7 @@ enum WarningLevel {
|
||||
|
||||
enum WarningID {
|
||||
WARNING_EMBEDDED, // Using an embedded PNG palette without '-c embedded'
|
||||
WARNING_OBSOLETE, // Obsolete/deprecated things
|
||||
WARNING_TRIM_NONEMPTY, // '-x' trims nonempty tiles
|
||||
|
||||
NB_PLAIN_WARNINGS,
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
.Nd Game Boy header utility and checksum fixer
|
||||
.Sh SYNOPSIS
|
||||
.Nm
|
||||
.Op Fl hjOsVvw
|
||||
.Op Fl hjsVvw
|
||||
.Op Fl C | c
|
||||
.Op Fl \-color Ar when
|
||||
.Op Fl f Ar fix_spec
|
||||
@@ -149,9 +149,6 @@ section below.
|
||||
Set the ROM version
|
||||
.Pq Ad 0x14C
|
||||
to a given value from 0 to 0xFF.
|
||||
.It Fl O , Fl \-overwrite
|
||||
Alias for
|
||||
.Fl Wno-overwrite .
|
||||
.It Fl o Ar out_file , Fl \-output Ar out_file
|
||||
Write the modified ROM image to the given file, or '-' to write to standard output.
|
||||
If not specified, the input files are modified in-place, or written to standard output if read from standard input.
|
||||
@@ -253,6 +250,8 @@ prefix, entries are listed alphabetically.
|
||||
.Bl -tag -width Ds
|
||||
.It Fl Wno-mbc
|
||||
Warn when there are inconsistencies with or caveats about the specified MBC type.
|
||||
.It Fl Wno-obsolete
|
||||
Warn when obsolete features are encountered, which have been deprecated and may later be removed.
|
||||
.It Fl Wno-overwrite
|
||||
Warn when overwriting different non-zero bytes in the header.
|
||||
.It Fl Wno-sgb
|
||||
|
||||
@@ -810,6 +810,8 @@ Warn when a generated palette is sorted according to the input PNG's embedded pa
|
||||
was not provided.
|
||||
This warning is enabled by
|
||||
.Fl Weverything .
|
||||
.It Fl Wno-obsolete
|
||||
Warn when obsolete features are encountered, which have been deprecated and may later be removed.
|
||||
.It Fl Wtrim-nonempty
|
||||
Warn when
|
||||
.Fl x
|
||||
|
||||
@@ -778,6 +778,7 @@ int main(int argc, char *argv[]) {
|
||||
break;
|
||||
|
||||
case 'O':
|
||||
warning(WARNING_OBSOLETE, "'-O' is deprecated; use '-Wno-overwrite' instead");
|
||||
warnings.processWarningFlag("no-overwrite");
|
||||
break;
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ Diagnostics<WarningLevel, WarningID> warnings = {
|
||||
},
|
||||
.warningFlags = {
|
||||
{"mbc", LEVEL_DEFAULT },
|
||||
{"obsolete", LEVEL_DEFAULT },
|
||||
{"overwrite", LEVEL_DEFAULT },
|
||||
{"sgb", LEVEL_DEFAULT },
|
||||
{"truncation", LEVEL_DEFAULT },
|
||||
|
||||
@@ -17,6 +17,7 @@ Diagnostics<WarningLevel, WarningID> warnings = {
|
||||
},
|
||||
.warningFlags = {
|
||||
{"embedded", LEVEL_EVERYTHING},
|
||||
{"obsolete", LEVEL_DEFAULT },
|
||||
{"trim-nonempty", LEVEL_ALL },
|
||||
},
|
||||
.paramWarnings = {},
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
-O -Cjv -t PM_CRYSTAL -i BYTE -n 0 -k 01 -l 0x33 -m 0x10 -r 3 -p 0
|
||||
Checks that the -O flag suppresses "Overwrote a non-zero byte" warnings from the rest
|
||||
-Wno-overwrite -Cjv -t PM_CRYSTAL -i BYTE -n 0 -k 01 -l 0x33 -m 0x10 -r 3 -p 0
|
||||
Checks that the -Wno-overwrite flag suppresses "Overwrote a non-zero byte" warnings from the rest
|
||||
|
||||
Reference in New Issue
Block a user