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.

Bug 224366

Summary: Displays error for valid C99 designated initializer.
Product: cnd Reporter: imjake9
Component: Code ModelAssignee: issues@cnd <issues>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: P3    
Version: 7.2.1   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description imjake9 2013-01-02 08:05:58 UTC
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".
Comment 1 soldatov 2013-01-02 09:23:11 UTC
no any problems in NetBeans 7.2 in such case:
struct a {
    int x;
};

struct a my_struct = { .x = 5 };
Comment 2 soldatov 2013-01-02 09:38:10 UTC
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);
}
Comment 3 imjake9 2013-01-02 09:45:57 UTC
Ah, yes, you're right, bad first example. It seems the error only occurs when the designated initializer syntax is used with compound literals.
Comment 4 petrk 2015-11-11 15:58:57 UTC

*** This bug has been marked as a duplicate of bug 246679 ***