This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

c/1527: initialization in zero-length array inside a nested structure



>Number:         1527
>Category:       c
>Synopsis:       initialization in zero-length array inside a nested structure
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Dec 29 12:46:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     Albert Cranford
>Release:        2.97 20001229 i386
>Organization:
>Environment:
binutils 2.10.1
glibc 2.1.2
>Description:
When compiling kernel 2.4.0-test13-pre5 get:

gcc -D__KERNEL__ -I/root/linux/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing -pipe -mpreferred-stack-boundary=2 -march=k6 -DMODULE   -c -o iptable_filter.o iptable_filter.c
iptable_filter.c:44: initialization of zero-length array inside a nested structure
iptable_filter.c:44: (near initialization for `initial_table.repl.entries')
iptable_filter.c:51: initialization of zero-length array inside a nested structure
iptable_filter.c:51: (near initialization for `initial_table.entries[0].entry.elems')
iptable_filter.c:52: initialization of zero-length array inside a nested structure
iptable_filter.c:52: (near initialization for `initial_table.entries[0].target.target.data')
iptable_filter.c:59: initialization of zero-length array inside a nested structure
iptable_filter.c:59: (near initialization for `initial_table.entries[1].entry.elems')
iptable_filter.c:60: initialization of zero-length array inside a nested structure
iptable_filter.c:60: (near initialization for `initial_table.entries[1].target.target.data')
iptable_filter.c:67: initialization of zero-length array inside a nested structure
iptable_filter.c:67: (near initialization for `initial_table.entries[2].entry.elems')
iptable_filter.c:68: initialization of zero-length array inside a nested structure
iptable_filter.c:68: (near initialization for `initial_table.entries[2].target.target.data')
iptable_filter.c:76: initialization of zero-length array inside a nested structure
iptable_filter.c:76: (near initialization for `initial_table.term.entry.elems')
iptable_filter.c:78: initialization of zero-length array inside a nested structure
iptable_filter.c:78: (near initialization for `initial_table.term.target.target.data')
confused by earlier errors, bailing out
make[2]: *** [iptable_filter.o] Error 1

static struct
{
	struct ipt_replace repl;
	struct ipt_standard entries[3];
	struct ipt_error term;
} initial_table __initdata
= { { "filter", FILTER_VALID_HOOKS, 4,
      sizeof(struct ipt_standard) * 3 + sizeof(struct ipt_error),
      { [NF_IP_LOCAL_IN] 0,
	[NF_IP_FORWARD] sizeof(struct ipt_standard),
	[NF_IP_LOCAL_OUT] sizeof(struct ipt_standard) * 2 },
      { [NF_IP_LOCAL_IN] 0,
	[NF_IP_FORWARD] sizeof(struct ipt_standard),
	[NF_IP_LOCAL_OUT] sizeof(struct ipt_standard) * 2 },
      0, NULL, { } },
    {
	    /* LOCAL_IN */
	    { { { { 0 }, { 0 }, { 0 }, { 0 }, "", "", { 0 }, { 0 }, 0, 0, 0 },
		0,
		sizeof(struct ipt_entry),
		sizeof(struct ipt_standard),
		0, { 0, 0 }, { } },
	      { { { { IPT_ALIGN(sizeof(struct ipt_standard_target)), "" } }, { } },
		-NF_ACCEPT - 1 } },
	    /* FORWARD */
	    { { { { 0 }, { 0 }, { 0 }, { 0 }, "", "", { 0 }, { 0 }, 0, 0, 0 },
		0,
		sizeof(struct ipt_entry),
		sizeof(struct ipt_standard),
		0, { 0, 0 }, { } },
	      { { { { IPT_ALIGN(sizeof(struct ipt_standard_target)), "" } }, { } },
		-NF_ACCEPT - 1 } },
	    /* LOCAL_OUT */
	    { { { { 0 }, { 0 }, { 0 }, { 0 }, "", "", { 0 }, { 0 }, 0, 0, 0 },
		0,
		sizeof(struct ipt_entry),
		sizeof(struct ipt_standard),
		0, { 0, 0 }, { } },
	      { { { { IPT_ALIGN(sizeof(struct ipt_standard_target)), "" } }, { } },
		-NF_ACCEPT - 1 } }
    },
    /* ERROR */
    { { { { 0 }, { 0 }, { 0 }, { 0 }, "", "", { 0 }, { 0 }, 0, 0, 0 },
	0,
	sizeof(struct ipt_entry),
	sizeof(struct ipt_error),
	0, { 0, 0 }, { } },
      { { { { IPT_ALIGN(sizeof(struct ipt_error_target)), IPT_ERROR_TARGET } },
	  { } },
	"ERROR"
      }
    }
};

>How-To-Repeat:
compile kernel for arch=i386
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]