This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
C99 designated initializers are not handled properly. Given a struct and initializer: struct a { int x; } struct a my_struct = { .x = 5 }; NetBeans reports an error on the line with description "Unable to resolve identifier x".
no any problems in NetBeans 7.2 in such case: struct a { int x; }; struct a my_struct = { .x = 5 };
valid scenario from forum: struct test { int x; int y; }; void displayTest(void *p) { } int main(int argc, char** argv) { displayTest(&(struct test){ .y = 10, .x = 20 }); return (0); }
Ah, yes, you're right, bad first example. It seems the error only occurs when the designated initializer syntax is used with compound literals.
*** This bug has been marked as a duplicate of bug 246679 ***