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 Don't warn about empty structs twice.
details: https://anonhg.NetBSD.org/src/rev/912c966edfc1
branches: trunk
changeset: 347256:912c966edfc1
user: christos <christos%NetBSD.org@localhost>
date: Fri Aug 19 11:51:27 2016 +0000
description:
Don't warn about empty structs twice.
diffstat:
usr.bin/xlint/lint1/decl.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diffs (31 lines):
diff -r 5dad999d1da3 -r 912c966edfc1 usr.bin/xlint/lint1/decl.c
--- a/usr.bin/xlint/lint1/decl.c Fri Aug 19 10:58:15 2016 +0000
+++ b/usr.bin/xlint/lint1/decl.c Fri Aug 19 11:51:27 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.63 2016/08/18 14:43:31 christos Exp $ */
+/* $NetBSD: decl.c,v 1.64 2016/08/19 11:51:27 christos 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.63 2016/08/18 14:43:31 christos Exp $");
+__RCSID("$NetBSD: decl.c,v 1.64 2016/08/19 11:51:27 christos Exp $");
#endif
#include <sys/param.h>
@@ -1789,10 +1789,9 @@
n++;
}
- if (n == 0) {
+ if (n == 0 && sp->size != 0) {
/* %s has no named members */
- warning(65,
- t == STRUCT ? "structure" : "union");
+ warning(65, t == STRUCT ? "structure" : "union");
}
} else {
tp->t_enum->elem = fmem;
Home |
Main Index |
Thread Index |
Old Index