Module Name: src
Committed By: rillig
Date: Fri Jan 15 22:07:54 UTC 2021
Modified Files:
src/tests/usr.bin/xlint/lint1: d_c99_bool_strict.c
d_c99_bool_strict.exp
src/usr.bin/xlint/lint1: ops.def
Log Message:
lint: in strict bool mode, allow bool as operands of the comma operator
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.exp
cvs rdiff -u -r1.10 -r1.11 src/usr.bin/xlint/lint1/ops.def
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c
diff -u src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c:1.5 src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c:1.6
--- src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c:1.5 Fri Jan 15 22:04:27 2021
+++ src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c Fri Jan 15 22:07:54 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: d_c99_bool_strict.c,v 1.5 2021/01/15 22:04:27 rillig Exp $ */
+/* $NetBSD: d_c99_bool_strict.c,v 1.6 2021/01/15 22:07:54 rillig Exp $ */
# 3 "d_c99_bool_strict.c"
/*
@@ -523,8 +523,9 @@ compare_var_with_constant(bool b)
}
bool
-SB003_operand_comma(bool b)
+SB003_operand_comma(bool b, int i)
{
- b = (b, !b); /* FIXME *//* expect: 336, 337 */
+ b = (b, !b);
+ i = (i, i + 1);
return b;
}
Index: src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.exp
diff -u src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.exp:1.4 src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.exp:1.5
--- src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.exp:1.4 Fri Jan 15 22:04:27 2021
+++ src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.exp Fri Jan 15 22:07:54 2021
@@ -101,5 +101,3 @@ d_c99_bool_strict.c(453): warning: illeg
d_c99_bool_strict.c(456): argument #1 expects '_Bool', gets passed 'pointer' [334]
d_c99_bool_strict.c(456): warning: illegal combination of integer (int) and pointer (pointer to const char), arg #2 [154]
d_c99_bool_strict.c(468): argument #1 expects '_Bool', gets passed 'int' [334]
-d_c99_bool_strict.c(528): left operand of ',' must not be bool [336]
-d_c99_bool_strict.c(528): right operand of ',' must not be bool [337]
Index: src/usr.bin/xlint/lint1/ops.def
diff -u src/usr.bin/xlint/lint1/ops.def:1.10 src/usr.bin/xlint/lint1/ops.def:1.11
--- src/usr.bin/xlint/lint1/ops.def:1.10 Tue Jan 12 20:42:01 2021
+++ src/usr.bin/xlint/lint1/ops.def Fri Jan 15 22:07:54 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ops.def,v 1.10 2021/01/12 20:42:01 rillig Exp $ */
+/* $NetBSD: ops.def,v 1.11 2021/01/15 22:07:54 rillig Exp $ */
begin_ops()
@@ -66,7 +66,7 @@ op( CON, "const", , , , , , , , , , , ,
op( STRING, "string", , , , , , , , , , , , , , , , , , , , ,1)
op( FSEL, "fsel", , , , , , , , , , , , , , , , , , , , ,1)
op( CALL, "call", 1, , , , , , , , , , , ,1, , , , , , , ,1)
-op( COMMA, ",", 1, , , , , , , , , , , , , , , , , , ,1,1)
+op( COMMA, ",", 1, ,1, , , , , , , , , , , , , , , , ,1,1)
op( CVT, "convert", , , , , , , , , ,1, , , , , , , , , , ,1)
op( ICALL, "icall", 1, , , , , , , , , , , ,1, , , , , , , ,1)
op( LOAD, "load", , , , , , , , , , , , , , , , , , , , ,1)