Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/usr.bin/xlint/lint1 lint: demonstrate wrong message fo...



details:   https://anonhg.NetBSD.org/src/rev/d770cb616c71
branches:  trunk
changeset: 958639:d770cb616c71
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Jan 15 22:04:27 2021 +0000

description:
lint: demonstrate wrong message for comma operator

diffstat:

 tests/usr.bin/xlint/lint1/d_c99_bool_strict.c   |  9 ++++++++-
 tests/usr.bin/xlint/lint1/d_c99_bool_strict.exp |  2 ++
 2 files changed, 10 insertions(+), 1 deletions(-)

diffs (29 lines):

diff -r a777fc7eebf2 -r d770cb616c71 tests/usr.bin/xlint/lint1/d_c99_bool_strict.c
--- a/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c     Fri Jan 15 21:14:53 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c     Fri Jan 15 22:04:27 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: d_c99_bool_strict.c,v 1.4 2021/01/12 20:42:01 rillig Exp $     */
+/*     $NetBSD: d_c99_bool_strict.c,v 1.5 2021/01/15 22:04:27 rillig Exp $     */
 # 3 "d_c99_bool_strict.c"
 
 /*
@@ -521,3 +521,10 @@
        bool t4 = t3 != 1;
        return t4 ^ t3;
 }
+
+bool
+SB003_operand_comma(bool b)
+{
+       b = (b, !b);            /* FIXME *//* expect: 336, 337 */
+       return b;
+}
diff -r a777fc7eebf2 -r d770cb616c71 tests/usr.bin/xlint/lint1/d_c99_bool_strict.exp
--- a/tests/usr.bin/xlint/lint1/d_c99_bool_strict.exp   Fri Jan 15 21:14:53 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/d_c99_bool_strict.exp   Fri Jan 15 22:04:27 2021 +0000
@@ -101,3 +101,5 @@
 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]



Home | Main Index | Thread Index | Old Index