Sun Jan 3 15:44:36 2021 UTC ()
lint: add test for message 124 "illegal pointer combination"

The message may be correct, but it is not helpful in any way.  There are
just too many function pointers that may differ in a very small detail.

Before tyname.c 1.20 from 2021-01-02, the string representation of type
names was often limited to only 63 characters.  Because of this, it made
sense to omit any detail that could need more space than this.  Now that
this limitation is gone, it's reasonable to add more detail to the type
information, especially since that information is readily available.


(rillig)
diff -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/msg_124.c
diff -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/msg_124.exp

cvs diff -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/msg_124.c (expand / switch to unified diff)

--- src/tests/usr.bin/xlint/lint1/msg_124.c 2021/01/02 10:22:43 1.1
+++ src/tests/usr.bin/xlint/lint1/msg_124.c 2021/01/03 15:44:35 1.2
@@ -1,7 +1,19 @@ @@ -1,7 +1,19 @@
1/* $NetBSD: msg_124.c,v 1.1 2021/01/02 10:22:43 rillig Exp $ */ 1/* $NetBSD: msg_124.c,v 1.2 2021/01/03 15:44:35 rillig Exp $ */
2# 3 "msg_124.c" 2# 3 "msg_124.c"
3 3
4// Test for message: illegal pointer combination, op %s [124] 4// Test for message: illegal pointer combination, op %s [124]
5 5
6TODO: "Add example code that triggers the above message." 6typedef void(*signal_handler)(int);
7TODO: "Add example code that almost triggers the above message." 7
 8typedef signal_handler(*sys_signal)(signal_handler);
 9
 10typedef int(*printflike)(const char *, ...)
 11 __attribute__((format(printf, 1, 2)));
 12
 13void
 14example(int *ptr)
 15{
 16 signal_handler handler = ptr;
 17 sys_signal signal = ptr;
 18 printflike printf = ptr;
 19}

cvs diff -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/Attic/msg_124.exp (expand / switch to unified diff)

--- src/tests/usr.bin/xlint/lint1/Attic/msg_124.exp 2021/01/02 10:22:43 1.1
+++ src/tests/usr.bin/xlint/lint1/Attic/msg_124.exp 2021/01/03 15:44:35 1.2