Book a Demo

Author Topic: crush because of nested class of a nested class  (Read 3267 times)

MREA

  • EA User
  • **
  • Posts: 72
  • Karma: +0/-0
    • View Profile
crush because of nested class of a nested class
« on: November 28, 2012, 05:43:43 pm »
Hi

I found out why EA was crashing all the time while generating code!

The problem was if you have a structure like that

class
    |_struct
         |_ struct
          |_union
.....

if the struct and the union are marked as nested, EA Crash while generating. If you delete all the nested links it work again!

should be fixed or am I the only one?
Support- Languages: German, English, French

g.makulik

  • EA User
  • **
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Re: crush because of nested class of a nested clas
« Reply #1 on: November 29, 2012, 07:45:51 am »
Hi,

I guess you want to have s.th. like this in the generated (C) code:

Code: [Select]
typedef struct
{
      struct Struct1_1
      {
            int attr1;
            int attr2[4];
      }  Struct1_1;


      union Union1_1
      {
            unsigned char attr1;
            unsigned char attr2[4];
      }  Union1_1;
      int attr1;
      int attr2;
}  Struct1;

I have achieved this reversed engineered model using the code from above within a class module named Class1.(h/c):



At least I've got no errors or EA crashes when newly generating or synchronizing from code or model.

HTH
Günther
« Last Edit: November 29, 2012, 07:56:53 am by g.makulik »
Using EA9.3, UML2.3, C++, linux, my brain, http://makulik.github.com/sttcl/

MREA

  • EA User
  • **
  • Posts: 72
  • Karma: +0/-0
    • View Profile
Re: crush because of nested class of a nested clas
« Reply #2 on: November 29, 2012, 05:15:00 pm »
actually sth like this

Code: [Select]
class
{
      struct
      {
            int attr1;
            int attr2[4];
      }  Struct1_1;


      union
      {
            unsigned char attr1;
            unsigned char attr2[4];
      }  Union1_1;
      int attr1;
      int attr2;
}
« Last Edit: November 29, 2012, 05:15:41 pm by EAIFM »
Support- Languages: German, English, French

g.makulik

  • EA User
  • **
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Re: crush because of nested class of a nested clas
« Reply #3 on: November 29, 2012, 07:27:05 pm »
I know that your code is also valid. But EA can't reverse engineer the contained structs without a name. They will be shown as <anonymous>.
Unfortunately forward code generation will also place <anonymous> as struct name then. May be it's possible to fix this in the code generaton templates.

Do you have legacy code you cannot change? Otherwise I would simply recommend giving the structs and unions a name.

Best regards,
Günther
Using EA9.3, UML2.3, C++, linux, my brain, http://makulik.github.com/sttcl/