Module Name: src
Committed By: rillig
Date: Fri Aug 27 19:50:44 UTC 2021
Modified Files:
src/tests/usr.bin/xlint/lint1: msg_179.c msg_179.exp
src/usr.bin/xlint/lint1: err.c
Log Message:
lint: remove unused message for struct without named members
Lint has not produced this message since the rewrite of the
initializations in March 2021. Structures that consist of only unnamed
bit-fields probably don't occur in practice.
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_179.c \
src/tests/usr.bin/xlint/lint1/msg_179.exp
cvs rdiff -u -r1.139 -r1.140 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_179.c
diff -u src/tests/usr.bin/xlint/lint1/msg_179.c:1.2 src/tests/usr.bin/xlint/lint1/msg_179.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_179.c:1.2 Sun Feb 21 09:07:58 2021
+++ src/tests/usr.bin/xlint/lint1/msg_179.c Fri Aug 27 19:50:44 2021
@@ -1,7 +1,24 @@
-/* $NetBSD: msg_179.c,v 1.2 2021/02/21 09:07:58 rillig Exp $ */
+/* $NetBSD: msg_179.c,v 1.3 2021/08/27 19:50:44 rillig Exp $ */
# 3 "msg_179.c"
// Test for message: cannot initialize struct/union with no named member [179]
+/* This message is not used. */
-TODO: "Add example code that triggers the above message." /* expect: 249 */
-TODO: "Add example code that almost triggers the above message."
+struct {
+ unsigned int :0;
+} no_named_member = {
+ /* no named member, therefore no initializer expression */
+};
+
+struct {
+ /* no members */
+} empty = {
+ /* no initializer expressions */
+};
+
+struct {
+ unsigned int: 0;
+} no_named_member_init = {
+ /* expect+1: error: too many struct/union initializers [172] */
+ 3,
+};
Index: src/tests/usr.bin/xlint/lint1/msg_179.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_179.exp:1.2 src/tests/usr.bin/xlint/lint1/msg_179.exp:1.3
--- src/tests/usr.bin/xlint/lint1/msg_179.exp:1.2 Sun Mar 21 20:45:00 2021
+++ src/tests/usr.bin/xlint/lint1/msg_179.exp Fri Aug 27 19:50:44 2021
@@ -1 +1 @@
-msg_179.c(6): error: syntax error ':' [249]
+msg_179.c(23): error: too many struct/union initializers [172]
Index: src/usr.bin/xlint/lint1/err.c
diff -u src/usr.bin/xlint/lint1/err.c:1.139 src/usr.bin/xlint/lint1/err.c:1.140
--- src/usr.bin/xlint/lint1/err.c:1.139 Mon Aug 23 06:50:01 2021
+++ src/usr.bin/xlint/lint1/err.c Fri Aug 27 19:50:44 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: err.c,v 1.139 2021/08/23 06:50:01 rillig Exp $ */
+/* $NetBSD: err.c,v 1.140 2021/08/27 19:50:44 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.139 2021/08/23 06:50:01 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.140 2021/08/27 19:50:44 rillig Exp $");
#endif
#include <sys/types.h>
@@ -233,7 +233,7 @@ const char *const msgs[] = {
"", /* no longer used */ /* 176 */
"non-constant initializer", /* 177 */
"initializer does not fit", /* 178 */
- "cannot initialize struct/union with no named member", /* 179 */
+ "", /* unused since 2021-03-29 */ /* 179 */
"bit-field initializer does not fit", /* 180 */
"{}-enclosed initializer required", /* 181 */
"incompatible pointer types (%s != %s)", /* 182 */