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 - Displays error for valid C99 designated initializer.
Summary: Displays error for valid C99 designated initializer.
Status: RESOLVED DUPLICATE of bug 246679
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 7.2.1
Hardware: All All
: P3 normal with 2 votes (vote)
Assignee: issues@cnd
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-02 08:05 UTC by imjake9
Modified: 2015-11-11 15:58 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***