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: be more precise in message 003 "ta...



details:   https://anonhg.NetBSD.org/src/rev/73f91e074f48
branches:  trunk
changeset: 959083:73f91e074f48
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Jan 31 09:26:27 2021 +0000

description:
lint: be more precise in message 003 "tag in argument list"

diffstat:

 tests/usr.bin/xlint/lint1/msg_003.exp |   6 +++---
 usr.bin/xlint/lint1/cgram.y           |  16 ++++++----------
 usr.bin/xlint/lint1/err.c             |   6 +++---
 3 files changed, 12 insertions(+), 16 deletions(-)

diffs (79 lines):

diff -r dfbf55cc040f -r 73f91e074f48 tests/usr.bin/xlint/lint1/msg_003.exp
--- a/tests/usr.bin/xlint/lint1/msg_003.exp     Sun Jan 31 09:21:24 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_003.exp     Sun Jan 31 09:26:27 2021 +0000
@@ -1,3 +1,3 @@
-msg_003.c(9): warning: struct declared in argument declaration list [3]
-msg_003.c(10): warning: union declared in argument declaration list [3]
-msg_003.c(11): warning: enum declared in argument declaration list [3]
+msg_003.c(9): warning: 'struct struct_in_argument' declared in argument declaration list [3]
+msg_003.c(10): warning: 'union union_in_argument' declared in argument declaration list [3]
+msg_003.c(11): warning: 'enum enum_in_argument' declared in argument declaration list [3]
diff -r dfbf55cc040f -r 73f91e074f48 usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y       Sun Jan 31 09:21:24 2021 +0000
+++ b/usr.bin/xlint/lint1/cgram.y       Sun Jan 31 09:26:27 2021 +0000
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.157 2021/01/18 19:24:09 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.158 2021/01/31 09:26:27 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: cgram.y,v 1.157 2021/01/18 19:24:09 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.158 2021/01/31 09:26:27 rillig Exp $");
 #endif
 
 #include <limits.h>
@@ -480,18 +480,14 @@
                        /* empty declaration */
                        warning(2);
                } else {
-                       tspec_t ts = dcs->d_type->t_tspec;
-                       /* %s declared in argument declaration list */
-                       warning(3, ts == STRUCT ? "struct" :
-                               (ts == UNION ? "union" : "enum"));
+                       /* '%s' declared in argument declaration list */
+                       warning(3, type_name(dcs->d_type));
                }
          }
        | declspecs deftyp type_init_decls T_SEMI {
                if (dcs->d_nedecl) {
-                       tspec_t ts = dcs->d_type->t_tspec;
-                       /* %s declared in argument declaration list */
-                       warning(3, ts == STRUCT ? "struct" :
-                               (ts == UNION ? "union" : "enum"));
+                       /* '%s' declared in argument declaration list */
+                       warning(3, type_name(dcs->d_type));
                }
          }
        | declmods error
diff -r dfbf55cc040f -r 73f91e074f48 usr.bin/xlint/lint1/err.c
--- a/usr.bin/xlint/lint1/err.c Sun Jan 31 09:21:24 2021 +0000
+++ b/usr.bin/xlint/lint1/err.c Sun Jan 31 09:26:27 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: err.c,v 1.72 2021/01/30 21:58:04 rillig Exp $  */
+/*     $NetBSD: err.c,v 1.73 2021/01/31 09:26:27 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.72 2021/01/30 21:58:04 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.73 2021/01/31 09:26:27 rillig Exp $");
 #endif
 
 #include <sys/types.h>
@@ -62,7 +62,7 @@
        "empty declaration",                                          /* 0 */
        "old style declaration; add int",                             /* 1 */
        "empty declaration",                                          /* 2 */
-       "%s declared in argument declaration list",                   /* 3 */
+       "'%s' declared in argument declaration list",                 /* 3 */
        "illegal type combination",                                   /* 4 */
        "modifying typedef with '%s'; only qualifiers allowed",       /* 5 */
        "use 'double' instead of 'long float'",                       /* 6 */



Home | Main Index | Thread Index | Old Index