This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
C99 structure initialization in gcc-2.95.3 vs gcc-3.3.1
- From: "Kevin P. Fleming" <kpfleming at cox dot net>
- To: gnu-gcc-bug at moderators dot isc dot org
- Date: Wed, 05 Nov 2003 22:17:17 -0700
- Subject: C99 structure initialization in gcc-2.95.3 vs gcc-3.3.1
- Newsgroups: gnu.gcc.bug
- Organization: Cox Communications
I've got an enum and a structure:
enum option_type {
O_STRING,
O_BOOL,
O_NUMBER
};
struct option_s {
char *name;
enum option_type type;
char *value;
char *def_value;
};
I want to define and initialize an instance of this structure:
static struct option_s foo_option = {
.name = "foo",
.type = O_STRING,
.def_value = "default"
};
With gcc-3.3.1, this works fine. With gcc-2.95.3, it complains about a
"missing initializer for .value". However, I know that the Linux kernel
uses this type of structure initialization, and it compiles OK with
gcc-2.95.3. Any ideas what's up here? I don't think this is actually a
syntax error on my part...