Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/xlint/lint1 lint: fix wording of message for incompl...



details:   https://anonhg.NetBSD.org/src/rev/25bb64aefd7a
branches:  trunk
changeset: 1022345:25bb64aefd7a
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Jul 13 22:01:34 2021 +0000

description:
lint: fix wording of message for incomplete struct (2021-07-04)

A struct member is not an argument.  In err.c 1.124 from 2021-07-04, the
wording had been changed, without noticing that the message was used
twice: once for an argument, once for a struct member.

diffstat:

 tests/usr.bin/xlint/lint1/msg_031.c   |  9 +++++----
 tests/usr.bin/xlint/lint1/msg_031.exp |  4 ++--
 tests/usr.bin/xlint/lint1/msg_067.c   |  5 ++---
 tests/usr.bin/xlint/lint1/msg_067.exp |  4 ++--
 tests/usr.bin/xlint/lint1/msg_152.exp |  4 ++--
 tests/usr.bin/xlint/lint1/msg_175.exp |  2 +-
 usr.bin/xlint/lint1/decl.c            |  6 +++---
 usr.bin/xlint/lint1/err.c             |  6 +++---
 8 files changed, 20 insertions(+), 20 deletions(-)

diffs (135 lines):

diff -r 812b686bde11 -r 25bb64aefd7a tests/usr.bin/xlint/lint1/msg_031.c
--- a/tests/usr.bin/xlint/lint1/msg_031.c       Tue Jul 13 21:50:05 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_031.c       Tue Jul 13 22:01:34 2021 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: msg_031.c,v 1.5 2021/07/04 13:31:10 rillig Exp $       */
+/*     $NetBSD: msg_031.c,v 1.6 2021/07/13 22:01:34 rillig Exp $       */
 # 3 "msg_031.c"
 
-// Test for message: argument '%s' has type '%s' [31]
+// Test for message: '%s' has incomplete type '%s' [31]
 
 struct complete {
        int dummy;
@@ -12,8 +12,9 @@
 
 struct complete complete_var;
 
-struct incomplete incomplete_var;      /* expect: 31 */
+/* expect+1: 'incomplete_var' has incomplete type 'incomplete struct incomplete' */
+struct incomplete incomplete_var;
 
 
-/* expect+1: error: argument '<unnamed>' has type 'incomplete struct incomplete' [31] */
+/* expect+1: '<unnamed>' has incomplete type 'incomplete struct incomplete' [31] */
 void function(struct incomplete);
diff -r 812b686bde11 -r 25bb64aefd7a tests/usr.bin/xlint/lint1/msg_031.exp
--- a/tests/usr.bin/xlint/lint1/msg_031.exp     Tue Jul 13 21:50:05 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_031.exp     Tue Jul 13 22:01:34 2021 +0000
@@ -1,3 +1,3 @@
-msg_031.c(19): error: argument '<unnamed>' has type 'incomplete struct incomplete' [31]
+msg_031.c(20): error: '<unnamed>' has incomplete type 'incomplete struct incomplete' [31]
 msg_031.c(10): warning: struct incomplete never defined [233]
-msg_031.c(15): error: argument 'incomplete_var' has type 'incomplete struct incomplete' [31]
+msg_031.c(16): error: 'incomplete_var' has incomplete type 'incomplete struct incomplete' [31]
diff -r 812b686bde11 -r 25bb64aefd7a tests/usr.bin/xlint/lint1/msg_067.c
--- a/tests/usr.bin/xlint/lint1/msg_067.c       Tue Jul 13 21:50:05 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_067.c       Tue Jul 13 22:01:34 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg_067.c,v 1.3 2021/07/13 21:50:05 rillig Exp $       */
+/*     $NetBSD: msg_067.c,v 1.4 2021/07/13 22:01:34 rillig Exp $       */
 # 3 "msg_067.c"
 
 // Test for message: cannot return incomplete type [67]
@@ -12,8 +12,7 @@
 function_definition(void)
 /* expect+1: error: cannot return incomplete type [67] */
 {
-       /* FIXME: 'r' is not an argument. */
-       /* expect+1: error: argument 'r' has type 'incomplete struct incomplete' [31] */
+       /* expect+1: error: 'r' has incomplete type 'incomplete struct incomplete' [31] */
        struct incomplete r;
 
        /* expect+1: error: cannot return incomplete type [212] */
diff -r 812b686bde11 -r 25bb64aefd7a tests/usr.bin/xlint/lint1/msg_067.exp
--- a/tests/usr.bin/xlint/lint1/msg_067.exp     Tue Jul 13 21:50:05 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_067.exp     Tue Jul 13 22:01:34 2021 +0000
@@ -1,4 +1,4 @@
 msg_067.c(14): error: cannot return incomplete type [67]
-msg_067.c(17): error: argument 'r' has type 'incomplete struct incomplete' [31]
-msg_067.c(20): error: cannot return incomplete type [212]
+msg_067.c(16): error: 'r' has incomplete type 'incomplete struct incomplete' [31]
+msg_067.c(19): error: cannot return incomplete type [212]
 msg_067.c(7): warning: struct incomplete never defined [233]
diff -r 812b686bde11 -r 25bb64aefd7a tests/usr.bin/xlint/lint1/msg_152.exp
--- a/tests/usr.bin/xlint/lint1/msg_152.exp     Tue Jul 13 21:50:05 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_152.exp     Tue Jul 13 22:01:34 2021 +0000
@@ -1,4 +1,4 @@
-msg_152.c(8): error: argument '<unnamed>' has type 'incomplete struct incomplete' [31]
-msg_152.c(13): error: argument 'local_var' has type 'incomplete struct incomplete' [31]
+msg_152.c(8): error: '<unnamed>' has incomplete type 'incomplete struct incomplete' [31]
+msg_152.c(13): error: 'local_var' has incomplete type 'incomplete struct incomplete' [31]
 msg_152.c(14): error: argument cannot have unknown size, arg #1 [152]
 msg_152.c(6): warning: struct incomplete never defined [233]
diff -r 812b686bde11 -r 25bb64aefd7a tests/usr.bin/xlint/lint1/msg_175.exp
--- a/tests/usr.bin/xlint/lint1/msg_175.exp     Tue Jul 13 21:50:05 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_175.exp     Tue Jul 13 22:01:34 2021 +0000
@@ -1,3 +1,3 @@
 msg_175.c(8): error: initialization of incomplete type 'incomplete struct incomplete' [175]
-msg_175.c(10): error: argument 'incomplete' has type 'incomplete struct incomplete' [31]
+msg_175.c(10): error: 'incomplete' has incomplete type 'incomplete struct incomplete' [31]
 msg_175.c(6): warning: struct incomplete never defined [233]
diff -r 812b686bde11 -r 25bb64aefd7a usr.bin/xlint/lint1/decl.c
--- a/usr.bin/xlint/lint1/decl.c        Tue Jul 13 21:50:05 2021 +0000
+++ b/usr.bin/xlint/lint1/decl.c        Tue Jul 13 22:01:34 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.198 2021/07/11 19:30:56 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.199 2021/07/13 22:01:34 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: decl.c,v 1.198 2021/07/11 19:30:56 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.199 2021/07/13 22:01:34 rillig Exp $");
 #endif
 
 #include <sys/param.h>
@@ -917,7 +917,7 @@
        case STRUCT:
        case UNION:
                if (is_incomplete(tp) && name != NULL) {
-                       /* argument '%s' has type '%s' */
+                       /* '%s' has incomplete type '%s' */
                        error(31, name, type_name(tp));
                }
                elsz = tp->t_str->sou_size_in_bits;
diff -r 812b686bde11 -r 25bb64aefd7a usr.bin/xlint/lint1/err.c
--- a/usr.bin/xlint/lint1/err.c Tue Jul 13 21:50:05 2021 +0000
+++ b/usr.bin/xlint/lint1/err.c Tue Jul 13 22:01:34 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: err.c,v 1.128 2021/07/11 19:30:56 rillig Exp $ */
+/*     $NetBSD: err.c,v 1.129 2021/07/13 22:01:34 rillig Exp $ */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: err.c,v 1.128 2021/07/11 19:30:56 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.129 2021/07/13 22:01:34 rillig Exp $");
 #endif
 
 #include <sys/types.h>
@@ -85,7 +85,7 @@
        "redefinition of %s",                                         /* 28 */
        "previously declared extern, becomes static: %s",             /* 29 */
        "redeclaration of %s; ANSI C requires static",                /* 30 */
-       "argument '%s' has type '%s'",                                /* 31 */
+       "'%s' has incomplete type '%s'",                              /* 31 */
        "argument type defaults to 'int': %s",                        /* 32 */
        "duplicate member name: %s",                                  /* 33 */
        "nonportable bit-field type '%s'",                            /* 34 */



Home | Main Index | Thread Index | Old Index