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 124 due to...



details:   https://anonhg.NetBSD.org/src/rev/a8409f3e271e
branches:  trunk
changeset: 950288:a8409f3e271e
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Jan 24 11:13:22 2021 +0000

description:
lint: demonstrate wrong 124 due to bug in is_typeok_eq

diffstat:

 tests/usr.bin/xlint/lint1/msg_124.c   |   8 +++++---
 tests/usr.bin/xlint/lint1/msg_124.exp |  12 +++++++-----
 2 files changed, 12 insertions(+), 8 deletions(-)

diffs (47 lines):

diff -r c8ed6c0ce540 -r a8409f3e271e tests/usr.bin/xlint/lint1/msg_124.c
--- a/tests/usr.bin/xlint/lint1/msg_124.c       Sun Jan 24 10:57:17 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_124.c       Sun Jan 24 11:13:22 2021 +0000
@@ -1,8 +1,10 @@
-/*     $NetBSD: msg_124.c,v 1.3 2021/01/24 10:50:42 rillig Exp $       */
+/*     $NetBSD: msg_124.c,v 1.4 2021/01/24 11:13:22 rillig Exp $       */
 # 3 "msg_124.c"
 
 // Test for message: illegal pointer combination, op %s [124]
 
+/* lint1-extra-flags: -s */
+
 typedef void(*signal_handler)(int);
 
 typedef signal_handler(*sys_signal)(signal_handler);
@@ -27,13 +29,13 @@
 {
        ok(vp == cp);
        ok(vp == ip);
-       ok(vp == fp);
+       ok(vp == fp);           /* expect: 274 */
        not_ok(cp == ip);       /* expect: 124 */
        not_ok(cp == fp);       /* expect: 124 */
        ok(vp == (void *)0);
        ok(cp == (void *)0);
        ok(ip == (void *)0);
-       ok(fp == (void *)0);
+       ok(fp == (void *)0);    /*FIXME*//* expect: 274 */
        ok(vp == 0);
        ok(cp == 0);
        ok(ip == 0);
diff -r c8ed6c0ce540 -r a8409f3e271e tests/usr.bin/xlint/lint1/msg_124.exp
--- a/tests/usr.bin/xlint/lint1/msg_124.exp     Sun Jan 24 10:57:17 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_124.exp     Sun Jan 24 11:13:22 2021 +0000
@@ -1,5 +1,7 @@
-msg_124.c(16): warning: illegal pointer combination (pointer to function(int) returning void) and (pointer to int), op = [124]
-msg_124.c(17): warning: illegal pointer combination (pointer to function(pointer to function(int) returning void) returning pointer to function(int) returning void) and (pointer to int), op = [124]
-msg_124.c(18): warning: illegal pointer combination (pointer to function(pointer to const char, ...) returning int) and (pointer to int), op = [124]
-msg_124.c(31): warning: illegal pointer combination (pointer to const char) and (pointer to const int), op == [124]
-msg_124.c(32): warning: illegal pointer combination (pointer to const char) and (pointer to function(int) returning void), op == [124]
+msg_124.c(18): warning: illegal pointer combination (pointer to function(int) returning void) and (pointer to int), op = [124]
+msg_124.c(19): warning: illegal pointer combination (pointer to function(pointer to function(int) returning void) returning pointer to function(int) returning void) and (pointer to int), op = [124]
+msg_124.c(20): warning: illegal pointer combination (pointer to function(pointer to const char, ...) returning int) and (pointer to int), op = [124]
+msg_124.c(32): warning: ANSI C forbids comparison of 'void *' with function pointer [274]
+msg_124.c(33): warning: illegal pointer combination (pointer to const char) and (pointer to const int), op == [124]
+msg_124.c(34): warning: illegal pointer combination (pointer to const char) and (pointer to function(int) returning void), op == [124]
+msg_124.c(38): warning: ANSI C forbids comparison of function pointer with 'void *' [274]



Home | Main Index | Thread Index | Old Index