Module Name: src Committed By: christos Date: Fri Aug 19 11:51:27 UTC 2016
Modified Files: src/usr.bin/xlint/lint1: decl.c Log Message: Don't warn about empty structs twice. To generate a diff of this commit: cvs rdiff -u -r1.63 -r1.64 src/usr.bin/xlint/lint1/decl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/xlint/lint1/decl.c diff -u src/usr.bin/xlint/lint1/decl.c:1.63 src/usr.bin/xlint/lint1/decl.c:1.64 --- src/usr.bin/xlint/lint1/decl.c:1.63 Thu Aug 18 10:43:31 2016 +++ src/usr.bin/xlint/lint1/decl.c Fri Aug 19 07:51:27 2016 @@ -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 @@ compltag(type_t *tp, sym_t *fmem) 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;