summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormartynas <martynas@openbsd.org>2011-07-11 17:30:10 +0000
committermartynas <martynas@openbsd.org>2011-07-11 17:30:10 +0000
commit7f928d9d36a6c0a6dc058c3096597e0713beede6 (patch)
tree86954a79d1eb8c6186242e0360cf3922cdfe224b
parentthere is a usage case where ypldap can be used without the local (diff)
downloadwireguard-openbsd-7f928d9d36a6c0a6dc058c3096597e0713beede6.tar.xz
wireguard-openbsd-7f928d9d36a6c0a6dc058c3096597e0713beede6.zip
Only complain about zero-sized structures/unions when in strict
ANSI C mode. Based on a diff from Theo.
-rw-r--r--usr.bin/xlint/lint1/decl.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.bin/xlint/lint1/decl.c b/usr.bin/xlint/lint1/decl.c
index 5b04c677bfe..df7ee66b272 100644
--- a/usr.bin/xlint/lint1/decl.c
+++ b/usr.bin/xlint/lint1/decl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: decl.c,v 1.28 2011/05/31 22:27:54 martynas Exp $ */
+/* $OpenBSD: decl.c,v 1.29 2011/07/11 17:30:10 martynas Exp $ */
/* $NetBSD: decl.c,v 1.11 1995/10/02 17:34:16 jpo Exp $ */
/*
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: decl.c,v 1.28 2011/05/31 22:27:54 martynas Exp $";
+static char rcsid[] = "$OpenBSD: decl.c,v 1.29 2011/07/11 17:30:10 martynas Exp $";
#endif
#include <sys/param.h>
@@ -1782,8 +1782,10 @@ compltag(type_t *tp, sym_t *fmem)
sp->size = dcs->d_offset;
sp->memb = fmem;
if (sp->size == 0) {
- /* zero sized %s */
- (void)gnuism(47, ttab[t].tt_name);
+ if (sflag) {
+ /* zero sized %s */
+ warning(47, ttab[t].tt_name);
+ }
} else {
n = 0;
for (mem = fmem; mem != NULL; mem = mem->s_nxt) {