Lower default -Wtrunction= level to 1

This commit is contained in:
Rangi42
2025-10-13 11:48:33 -04:00
parent aa672bbec9
commit 64bcef99bd
6 changed files with 7 additions and 15 deletions
+2 -2
View File
@@ -460,10 +460,10 @@ or
.Fl Wno-truncation
disables this warning.
.Fl Wtruncation=1
warns when an N-bit value is 2**N or greater, or less than -2**N.
.Fl Wtruncation=2
or just
.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.
.It Fl Wunmapped-char=
Warn when a character goes through charmap conversion but has no defined mapping.
+2 -2
View File
@@ -327,10 +327,10 @@ or
.Fl Wno-truncation
disables this warning.
.Fl Wtruncation=1
warns when an N-bit value is 2**N or greater, or less than -2**N.
.Fl Wtruncation=2
or just
.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.
.El
.Sh EXAMPLES
+1 -1
View File
@@ -53,7 +53,7 @@ Diagnostics<WarningLevel, WarningID> warnings = {
.paramWarnings = {
{WARNING_NUMERIC_STRING_1, WARNING_NUMERIC_STRING_2, 1},
{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},
},
.state = DiagnosticsState<WarningID>(),
+1 -1
View File
@@ -31,7 +31,7 @@ Diagnostics<WarningLevel, WarningID> warnings = {
{"truncation", LEVEL_EVERYTHING},
},
.paramWarnings = {
{WARNING_TRUNCATION_1, WARNING_TRUNCATION_2, 2},
{WARNING_TRUNCATION_1, WARNING_TRUNCATION_2, 1},
},
.state = DiagnosticsState<WarningID>(),
.nbErrors = 0,
+1 -1
View File
@@ -32,7 +32,7 @@ MACRO try
ENDM
try Wno-truncation
try Wtruncation
try Wtruncation ; defaults to 1
try Wtruncation=0
try Wtruncation=1
try Wtruncation=2
-8
View File
@@ -6,14 +6,6 @@ warning: Expression must be 16-bit [-Wtruncation]
at warn-truncation.asm::try(25) <- warn-truncation.asm(35)
warning: Expression must be 16-bit [-Wtruncation]
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]
at warn-truncation.asm::try(23) <- warn-truncation.asm(37)
warning: Expression must be 8-bit; use `LOW()` to force 8-bit [-Wtruncation]