Make implicit truncation a warning

This commit is contained in:
ISSOtm
2020-02-05 13:20:51 +01:00
parent 35f7340dc9
commit 28473d314a
3 changed files with 5 additions and 2 deletions

View File

@@ -1190,7 +1190,7 @@ constlist_32bit_entry : /* empty */
const_8bit : relocconst
{
if( (!rpn_isReloc(&$1)) && (($1.nVal < -128) || ($1.nVal > 255)) )
yyerror("Expression must be 8-bit");
warning(WARNING_TRUNCATION, "Expression must be 8-bit");
$$ = $1;
}
;
@@ -1198,7 +1198,7 @@ const_8bit : relocconst
const_16bit : relocconst
{
if ((!rpn_isReloc(&$1)) && (($1.nVal < -32768) || ($1.nVal > 65535)))
yyerror("Expression must be 16-bit");
warning(WARNING_TRUNCATION, "Expression must be 16-bit");
$$ = $1;
}
;