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 tests/lint: add test for incompati...



details:   https://anonhg.NetBSD.org/src/rev/33642c46525f
branches:  trunk
changeset: 960431:33642c46525f
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Mar 19 08:01:58 2021 +0000

description:
tests/lint: add test for incompatible pointer types in return

diffstat:

 tests/usr.bin/xlint/lint1/msg_184.c   |  9 ++++++---
 tests/usr.bin/xlint/lint1/msg_184.exp |  2 +-
 2 files changed, 7 insertions(+), 4 deletions(-)

diffs (23 lines):

diff -r 264aae4a4302 -r 33642c46525f tests/usr.bin/xlint/lint1/msg_184.c
--- a/tests/usr.bin/xlint/lint1/msg_184.c       Fri Mar 19 07:54:13 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_184.c       Fri Mar 19 08:01:58 2021 +0000
@@ -1,7 +1,10 @@
-/*     $NetBSD: msg_184.c,v 1.2 2021/02/21 09:07:58 rillig Exp $       */
+/*     $NetBSD: msg_184.c,v 1.3 2021/03/19 08:01:58 rillig Exp $       */
 # 3 "msg_184.c"
 
 // Test for message: illegal pointer combination [184]
 
-TODO: "Add example code that triggers the above message." /* expect: 249 */
-TODO: "Add example code that almost triggers the above message."
+int *
+example(char *cp)
+{
+       return cp;              /* expect: 184 */
+}
diff -r 264aae4a4302 -r 33642c46525f tests/usr.bin/xlint/lint1/msg_184.exp
--- a/tests/usr.bin/xlint/lint1/msg_184.exp     Fri Mar 19 07:54:13 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_184.exp     Fri Mar 19 08:01:58 2021 +0000
@@ -1,1 +1,1 @@
-msg_184.c(6): syntax error ':' [249]
+msg_184.c(9): warning: illegal pointer combination [184]



Home | Main Index | Thread Index | Old Index