ng_bpf compiled with gcc3

YONETANI Tomokazu qhwt+dragonfly-submit at les.ath.cx
Sat Feb 14 09:09:31 PST 2004


Hi.
This is a fix from FreeBSD-CURRENT. Not only does it silence the warning,
but ng_bpf is broken without this when compiled with gcc3.

|revision 1.7
|date: 2002/06/01 20:40:05;  author: alfred;  state: Exp;  lines: +1 -1
|Declare a variable sized array within a structure using [] rather than [0]
|to silence warnings.

Index: sys/netgraph/bpf/ng_bpf.h
===================================================================
RCS file: /home/source/dragonfly/cvs/src/sys/netgraph/bpf/ng_bpf.h,v
retrieving revision 1.2
diff -u -r1.2 ng_bpf.h
--- sys/netgraph/bpf/ng_bpf.h	17 Jun 2003 04:28:49 -0000	1.2
+++ sys/netgraph/bpf/ng_bpf.h	14 Feb 2004 16:58:53 -0000
@@ -54,7 +54,7 @@
 	char		ifMatch[NG_HOOKLEN+1];		/* match dest hook */
 	char		ifNotMatch[NG_HOOKLEN+1];	/* !match dest hook */
 	int32_t		bpf_prog_len;			/* #isns in program */
-	struct bpf_insn	bpf_prog[0];			/* bpf program */
+	struct bpf_insn	bpf_prog[];			/* bpf program */
 };
 
 #define NG_BPF_HOOKPROG_SIZE(numInsn)	\





More information about the Submit mailing list