This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

C99 structure initialization in gcc-2.95.3 vs gcc-3.3.1


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...


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