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 246680 - C99: nested c99 initializer (2)
Summary: C99: nested c99 initializer (2)
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 8.0
Hardware: PC Solaris
: P3 normal (vote)
Assignee: petrk
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-25 15:36 UTC by Alexander Simon
Modified: 2016-03-16 08:12 UTC (History)
2 users (show)

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 Alexander Simon 2014-08-25 15:36:47 UTC
Unable to resolve identifier a2                                              
      

C code:
struct A0 {
    struct A1 {
        struct A2 {
                int a3;
        } a2[3];
    } a1[3];
};
typedef struct A0 A;

int main() {
    A aa = {.a1[0].a2[0].a3 = 111};
    return 0;
}
Comment 1 Quality Engineering 2015-10-30 02:21:54 UTC
Integrated into 'main-silver', will be available in build *201510300002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/9c89bf9cb211
User: Petr Kudryavtsev <petrk@netbeans.org>
Log: Fixed #246680 - C99: nested c99 initializer (2)
(transplanted from 95f212d8db5ef2ad4a31ae09d507c40f1327d217)
Comment 2 mrellis63 2015-10-31 00:34:51 UTC
Still unable to resolve identifier ".Data" in first line of main() example below;

 struct UrxUnitStruct 
{ //UART Rx unit
    uint8_t Data; //The character received
    uint8_t Errs; //Errors detected at certain character reception
};

 struct UrxStatusStruct 
{ 
    struct UrxUnitStruct *WrPtr; //UART Rx software buffer write pointer
    struct UrxUnitStruct *RePtr; //UART Rx software buffer read pointer
};

volatile struct UrxUnitStruct U1RxBuff[128]; //Rx SW buffer
volatile struct UrxStatusStruct U1RxStatus; //Rx SW buffer status


int main(void) 
{

//For this form the compiler does not warn and code compiles and works  //correctly. Parser indicates that .Data field is NOT resolvable
  (*((U1RxStatus.WrPtr)++)).Data = 0x20;

  //Parser resolves .Data field for these two forms;
  //(*((U1RxStatus.WrPtr))++).Data = 0x20;
  //(*U1RxStatus.WrPtr++).Data = 0x20; 
  
  return 0
}
Comment 3 petrk 2015-10-31 18:44:44 UTC
This has nothing to do with initializers, so I've opened another one bug 256296 for that case.
Comment 4 petrk 2015-11-02 19:45:13 UTC
Additional fix to solve some performance issues: 303833:6a84cca6e3c6
Comment 5 Quality Engineering 2015-11-10 02:31:52 UTC
Integrated into 'main-silver', will be available in build *201511100002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/79868419f5a5
User: Petr Kudryavtsev <petrk@netbeans.org>
Log: Additional fix for #246680 - C99: nested c99 initializer (2)
-- added caching of the last path in initializer to increase performance on really large initializers
(transplanted from 6a84cca6e3c6d1d6668039d992abfbf2f339ba40)
Comment 6 Alexander Simon 2015-11-17 12:47:19 UTC
v.
Comment 7 soldatov 2015-11-20 11:56:25 UTC
Verified in NetBeans 8.1patch1