Book a Demo

Author Topic: C code generation and typedef  (Read 21196 times)

Martin Merkel

  • EA User
  • **
  • Posts: 24
  • Karma: +0/-0
    • View Profile
C code generation and typedef
« on: February 02, 2021, 01:19:28 am »
Hi,
I'm trying to understand how to model typedef constructs in EA (15.2) such I get a typedef in generated C code.

Initially I started with C source and header files that look like that (simplified):

Class.c
Code: [Select]
#include "Class.h"

Enumeration_t Attribute;

and

Class.h
Code: [Select]
enum Enumeration
{
    Enumerator1,
    Enumerator2
};

typedef enum Enumeration Enumeration_t;


After importing the code into EA, I obtain the following:





When I then forward engineer C code, my typedef is gone. I cannot set any roles on the Generalization that EA thought to have identified between the <<typedef>> and the <<enumeration>>. I also cannot create a Generalization link between the typedef and the enumeration manually. What am I missing here?

Thanks
Martin
« Last Edit: February 02, 2021, 06:37:52 am by Martin Merkel »

mse

  • EA User
  • **
  • Posts: 308
  • Karma: +1/-0
    • View Profile
Re: C code generation and typedef
« Reply #1 on: February 21, 2026, 12:21:33 am »
I modeled this one exactly how you have it shown and was able to forward-generate the C++ code. How did you create the generalization arrow from Enumeration_t to Enumeration1 however?