mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Lower default -Wtrunction= level to 1
This commit is contained in:
@@ -460,10 +460,10 @@ or
|
|||||||
.Fl Wno-truncation
|
.Fl Wno-truncation
|
||||||
disables this warning.
|
disables this warning.
|
||||||
.Fl Wtruncation=1
|
.Fl Wtruncation=1
|
||||||
warns when an N-bit value is 2**N or greater, or less than -2**N.
|
|
||||||
.Fl Wtruncation=2
|
|
||||||
or just
|
or just
|
||||||
.Fl Wtruncation
|
.Fl Wtruncation
|
||||||
|
warns when an N-bit value is 2**N or greater, or less than -2**N.
|
||||||
|
.Fl Wtruncation=2
|
||||||
also warns when an N-bit value is less than -2**(N-1), which will not fit in two's complement encoding.
|
also warns when an N-bit value is less than -2**(N-1), which will not fit in two's complement encoding.
|
||||||
.It Fl Wunmapped-char=
|
.It Fl Wunmapped-char=
|
||||||
Warn when a character goes through charmap conversion but has no defined mapping.
|
Warn when a character goes through charmap conversion but has no defined mapping.
|
||||||
|
|||||||
@@ -327,10 +327,10 @@ or
|
|||||||
.Fl Wno-truncation
|
.Fl Wno-truncation
|
||||||
disables this warning.
|
disables this warning.
|
||||||
.Fl Wtruncation=1
|
.Fl Wtruncation=1
|
||||||
warns when an N-bit value is 2**N or greater, or less than -2**N.
|
|
||||||
.Fl Wtruncation=2
|
|
||||||
or just
|
or just
|
||||||
.Fl Wtruncation
|
.Fl Wtruncation
|
||||||
|
warns when an N-bit value is 2**N or greater, or less than -2**N.
|
||||||
|
.Fl Wtruncation=2
|
||||||
also warns when an N-bit value is less than -2**(N-1), which will not fit in two's complement encoding.
|
also warns when an N-bit value is less than -2**(N-1), which will not fit in two's complement encoding.
|
||||||
.El
|
.El
|
||||||
.Sh EXAMPLES
|
.Sh EXAMPLES
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ Diagnostics<WarningLevel, WarningID> warnings = {
|
|||||||
.paramWarnings = {
|
.paramWarnings = {
|
||||||
{WARNING_NUMERIC_STRING_1, WARNING_NUMERIC_STRING_2, 1},
|
{WARNING_NUMERIC_STRING_1, WARNING_NUMERIC_STRING_2, 1},
|
||||||
{WARNING_PURGE_1, WARNING_PURGE_2, 2},
|
{WARNING_PURGE_1, WARNING_PURGE_2, 2},
|
||||||
{WARNING_TRUNCATION_1, WARNING_TRUNCATION_2, 2},
|
{WARNING_TRUNCATION_1, WARNING_TRUNCATION_2, 1},
|
||||||
{WARNING_UNMAPPED_CHAR_1, WARNING_UNMAPPED_CHAR_2, 1},
|
{WARNING_UNMAPPED_CHAR_1, WARNING_UNMAPPED_CHAR_2, 1},
|
||||||
},
|
},
|
||||||
.state = DiagnosticsState<WarningID>(),
|
.state = DiagnosticsState<WarningID>(),
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ Diagnostics<WarningLevel, WarningID> warnings = {
|
|||||||
{"truncation", LEVEL_EVERYTHING},
|
{"truncation", LEVEL_EVERYTHING},
|
||||||
},
|
},
|
||||||
.paramWarnings = {
|
.paramWarnings = {
|
||||||
{WARNING_TRUNCATION_1, WARNING_TRUNCATION_2, 2},
|
{WARNING_TRUNCATION_1, WARNING_TRUNCATION_2, 1},
|
||||||
},
|
},
|
||||||
.state = DiagnosticsState<WarningID>(),
|
.state = DiagnosticsState<WarningID>(),
|
||||||
.nbErrors = 0,
|
.nbErrors = 0,
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ MACRO try
|
|||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
try Wno-truncation
|
try Wno-truncation
|
||||||
try Wtruncation
|
try Wtruncation ; defaults to 1
|
||||||
try Wtruncation=0
|
try Wtruncation=0
|
||||||
try Wtruncation=1
|
try Wtruncation=1
|
||||||
try Wtruncation=2
|
try Wtruncation=2
|
||||||
|
|||||||
@@ -6,14 +6,6 @@ warning: Expression must be 16-bit [-Wtruncation]
|
|||||||
at warn-truncation.asm::try(25) <- warn-truncation.asm(35)
|
at warn-truncation.asm::try(25) <- warn-truncation.asm(35)
|
||||||
warning: Expression must be 16-bit [-Wtruncation]
|
warning: Expression must be 16-bit [-Wtruncation]
|
||||||
at warn-truncation.asm::try(26) <- warn-truncation.asm(35)
|
at warn-truncation.asm::try(26) <- warn-truncation.asm(35)
|
||||||
warning: Expression must be 8-bit; use `LOW()` to force 8-bit [-Wtruncation]
|
|
||||||
at warn-truncation.asm::try(28) <- warn-truncation.asm(35)
|
|
||||||
warning: Expression must be 16-bit [-Wtruncation]
|
|
||||||
at warn-truncation.asm::try(29) <- warn-truncation.asm(35)
|
|
||||||
warning: Expression must be 8-bit; use `LOW()` to force 8-bit [-Wtruncation]
|
|
||||||
at warn-truncation.asm::try(30) <- warn-truncation.asm(35)
|
|
||||||
warning: Expression must be 16-bit [-Wtruncation]
|
|
||||||
at warn-truncation.asm::try(31) <- warn-truncation.asm(35)
|
|
||||||
warning: Expression must be 8-bit; use `LOW()` to force 8-bit [-Wtruncation]
|
warning: Expression must be 8-bit; use `LOW()` to force 8-bit [-Wtruncation]
|
||||||
at warn-truncation.asm::try(23) <- warn-truncation.asm(37)
|
at warn-truncation.asm::try(23) <- warn-truncation.asm(37)
|
||||||
warning: Expression must be 8-bit; use `LOW()` to force 8-bit [-Wtruncation]
|
warning: Expression must be 8-bit; use `LOW()` to force 8-bit [-Wtruncation]
|
||||||
|
|||||||
Reference in New Issue
Block a user