two fixes to the lint part: unsigned constant compares, and initializations in switch headers

This commit is contained in:
ceriel
1990-02-26 11:35:15 +00:00
parent 8d04be4a13
commit 29152cbf74
4 changed files with 10 additions and 2 deletions

View File

@@ -362,7 +362,7 @@ lint_relop(left, right, oper)
&& right->ex_class == Value
&& right->VL_CLASS == Const
) {
if (right->VL_VALUE < 0) {
if (!right->ex_type->tp_unsigned && right->VL_VALUE < 0) {
warning("unsigned compared to negative constant");
}
if (right->VL_VALUE == 0) {