diff --git a/tests/usr.bin/xlint/lint1/msg_003.exp b/tests/usr.bin/xlint/lint1/msg_003.exp index 037c69ba1033..60d91d328faa 100644 --- a/tests/usr.bin/xlint/lint1/msg_003.exp +++ b/tests/usr.bin/xlint/lint1/msg_003.exp @@ -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 --git a/usr.bin/xlint/lint1/cgram.y b/usr.bin/xlint/lint1/cgram.y index a166f3d18fb7..da03cd91d496 100644 --- a/usr.bin/xlint/lint1/cgram.y +++ b/usr.bin/xlint/lint1/cgram.y @@ -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 #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 @@ -480,18 +480,14 @@ arg_declaration: /* 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 --git a/usr.bin/xlint/lint1/err.c b/usr.bin/xlint/lint1/err.c index 3407bbb0cc06..8137cac4b23d 100644 --- a/usr.bin/xlint/lint1/err.c +++ b/usr.bin/xlint/lint1/err.c @@ -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 #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 @@ -62,7 +62,7 @@ const char *msgs[] = { "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 */