View Issue Details

IDProjectCategoryView StatusLast Update
0001052Ecere SDKcompilerpublic2014-04-30 09:34
Reporternicktick Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status confirmedResolutionopen 
Product Version0.44.09 
Target Version0.46 eC II 
Summary0001052: ecc gives an error de-referencing a pointer to a local struct
Descriptionvoid Test()
{
  struct SS
  {
    uint a;
    union
    {
      uint b;
      uint c;
     }x;
   };
   struct SS *p;
   p = new struct SS[10];
   p[2].x.b=1; //compilation error here
   p->x.b=1; // or here
}
compilation errrors:
   form1.ec:170:10: error: couldn't determine type of p[2].x
   form1.ec:170:10: error: member operator on non-structure type expression p[2].x.b
   form1.ec:170:10: error: couldn't determine type of p[2].x.b
   form1.ec:170:10: error: couldn't determine type of p[2].x.b
   form1.ec:170:10: error: couldn't determine type of p[2].x.b = 1
TagsNo tags attached.

Activities

jerome

2014-01-04 03:53

administrator   ~0001148

This works fine:

void Test()
{
   struct SS
   {
      uint a;
      union
      {
         uint b;
         uint c;
      }x;
   } * p = new struct SS[10];
   p[2].x.b=1;
}

And so does this:

struct SS
{
   uint a;
   union
   {
      uint b;
      uint c;
   }x;
};
 
void Test()
{
   struct SS * p = new struct SS[10];
   p[2].x.b=1;
}

Issue History

Date Modified Username Field Change
2014-01-04 03:49 nicktick New Issue
2014-01-04 03:53 jerome Note Added: 0001148
2014-01-04 03:54 jerome Status new => confirmed
2014-01-04 03:55 jerome Summary compilation error on struct => compilation error de-referencing an array of a local struct
2014-01-04 03:55 jerome Description Updated
2014-01-04 03:55 jerome Summary compilation error de-referencing an array of a local struct => compilation error de-referencing a pointer to a local struct
2014-01-04 03:56 jerome Description Updated
2014-01-04 03:56 jerome Summary compilation error de-referencing a pointer to a local struct => ecc gives an error de-referencing a pointer to a local struct
2014-04-30 09:34 jerome Target Version => 0.46 eC II