Module Name: src Committed By: rillig Date: Tue Jul 13 22:01:34 UTC 2021
Modified Files: src/tests/usr.bin/xlint/lint1: msg_031.c msg_031.exp msg_067.c msg_067.exp msg_152.exp msg_175.exp src/usr.bin/xlint/lint1: decl.c err.c Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/msg_031.c \ src/tests/usr.bin/xlint/lint1/msg_031.exp cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_067.c \ src/tests/usr.bin/xlint/lint1/msg_067.exp cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_152.exp cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/xlint/lint1/msg_175.exp cvs rdiff -u -r1.198 -r1.199 src/usr.bin/xlint/lint1/decl.c cvs rdiff -u -r1.128 -r1.129 src/usr.bin/xlint/lint1/err.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/tests/usr.bin/xlint/lint1/msg_031.c diff -u src/tests/usr.bin/xlint/lint1/msg_031.c:1.5 src/tests/usr.bin/xlint/lint1/msg_031.c:1.6 --- src/tests/usr.bin/xlint/lint1/msg_031.c:1.5 Sun Jul 4 13:31:10 2021 +++ src/tests/usr.bin/xlint/lint1/msg_031.c Tue Jul 13 22:01:34 2021 @@ -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 incomplete; /* expect: 233 */ 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); Index: src/tests/usr.bin/xlint/lint1/msg_031.exp diff -u src/tests/usr.bin/xlint/lint1/msg_031.exp:1.5 src/tests/usr.bin/xlint/lint1/msg_031.exp:1.6 --- src/tests/usr.bin/xlint/lint1/msg_031.exp:1.5 Sun Jul 4 13:31:10 2021 +++ src/tests/usr.bin/xlint/lint1/msg_031.exp Tue Jul 13 22:01:34 2021 @@ -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] Index: src/tests/usr.bin/xlint/lint1/msg_067.c diff -u src/tests/usr.bin/xlint/lint1/msg_067.c:1.3 src/tests/usr.bin/xlint/lint1/msg_067.c:1.4 --- src/tests/usr.bin/xlint/lint1/msg_067.c:1.3 Tue Jul 13 21:50:05 2021 +++ src/tests/usr.bin/xlint/lint1/msg_067.c Tue Jul 13 22:01:34 2021 @@ -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 @@ struct incomplete 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] */ Index: src/tests/usr.bin/xlint/lint1/msg_067.exp diff -u src/tests/usr.bin/xlint/lint1/msg_067.exp:1.3 src/tests/usr.bin/xlint/lint1/msg_067.exp:1.4 --- src/tests/usr.bin/xlint/lint1/msg_067.exp:1.3 Tue Jul 13 21:50:05 2021 +++ src/tests/usr.bin/xlint/lint1/msg_067.exp Tue Jul 13 22:01:34 2021 @@ -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] Index: src/tests/usr.bin/xlint/lint1/msg_152.exp diff -u src/tests/usr.bin/xlint/lint1/msg_152.exp:1.4 src/tests/usr.bin/xlint/lint1/msg_152.exp:1.5 --- src/tests/usr.bin/xlint/lint1/msg_152.exp:1.4 Sun Jul 4 13:31:10 2021 +++ src/tests/usr.bin/xlint/lint1/msg_152.exp Tue Jul 13 22:01:34 2021 @@ -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] Index: src/tests/usr.bin/xlint/lint1/msg_175.exp diff -u src/tests/usr.bin/xlint/lint1/msg_175.exp:1.7 src/tests/usr.bin/xlint/lint1/msg_175.exp:1.8 --- src/tests/usr.bin/xlint/lint1/msg_175.exp:1.7 Sun Jul 4 13:31:10 2021 +++ src/tests/usr.bin/xlint/lint1/msg_175.exp Tue Jul 13 22:01:34 2021 @@ -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] Index: src/usr.bin/xlint/lint1/decl.c diff -u src/usr.bin/xlint/lint1/decl.c:1.198 src/usr.bin/xlint/lint1/decl.c:1.199 --- src/usr.bin/xlint/lint1/decl.c:1.198 Sun Jul 11 19:30:56 2021 +++ src/usr.bin/xlint/lint1/decl.c Tue Jul 13 22:01:34 2021 @@ -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 @@ length(const type_t *tp, const char *nam 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; Index: src/usr.bin/xlint/lint1/err.c diff -u src/usr.bin/xlint/lint1/err.c:1.128 src/usr.bin/xlint/lint1/err.c:1.129 --- src/usr.bin/xlint/lint1/err.c:1.128 Sun Jul 11 19:30:56 2021 +++ src/usr.bin/xlint/lint1/err.c Tue Jul 13 22:01:34 2021 @@ -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 @@ const char *const msgs[] = { "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 */