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: add test for message 108, wh...



details:   https://anonhg.NetBSD.org/src/rev/d15f9b460e5d
branches:  trunk
changeset: 958528:d15f9b460e5d
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Jan 09 17:02:19 2021 +0000

description:
lint: add test for message 108, which currently crashes

diffstat:

 tests/usr.bin/xlint/lint1/msg_108.c |  19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r 160d15e0e7d4 -r d15f9b460e5d tests/usr.bin/xlint/lint1/msg_108.c
--- a/tests/usr.bin/xlint/lint1/msg_108.c       Sat Jan 09 16:44:35 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_108.c       Sat Jan 09 17:02:19 2021 +0000
@@ -1,7 +1,22 @@
-/*     $NetBSD: msg_108.c,v 1.1 2021/01/02 10:22:43 rillig Exp $       */
+/*     $NetBSD: msg_108.c,v 1.2 2021/01/09 17:02:19 rillig Exp $       */
 # 3 "msg_108.c"
 
 // Test for message: operand of '%s' has incompatible type (%s != %s) [108]
 
 TODO: "Add example code that triggers the above message."
-TODO: "Add example code that almost triggers the above message."
+TODO: "Add example code that almost triggers the above message.";
+
+struct s {
+       int member;
+};
+
+void
+example(void)
+{
+       struct s s;
+
+       // FIXME: msg_108.c(14): lint error: common/tyname.c, 190: tspec_name(0)
+       // basic_type_name (t=NOTSPEC)
+       // warn_incompatible_types (op=COMPL, lt=STRUCT, rt=NOTSPEC)
+       //s = ~s;
+}



Home | Main Index | Thread Index | Old Index