Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: mse on November 14, 2024, 11:59:25 pm

Title: C code generation not working for typedef struct declarations
Post by: mse on November 14, 2024, 11:59:25 pm
I am making sure I can generate different sorts of C declarations from a UML model, but one I cannot figure out is something like the following:

Code: [Select]
typedef struct vlink_conf Vlink_conf;
I can only get the following, which is not valid C syntax:

Code: [Select]
typedef struct vlink_conf Vlink_conf;

struct vlink_conf
{
char network;
char integrity;
} ;

My diagram looks like the following:

(https://www.plantuml.com/plantuml/png/JOx13e8m38RF_a_Hk-45b2myXLU3ey32DaXND4HzToNii5lpfT_NDabRqJLuO7GT4uT5DmeS7YpfGDQ9zGnOtwP4J-_YTBTpxAckayfgrHZ26oSwHzRNBDE5xDZA3bnK7iJfbj4tHsvbHBU5E-wD0ShufwgAFI3EoYHk61MK5Jhk5pyLnXKSEzejeFcFQ_0_)


I have tried with using the C options tagged values but with limited success. This is the closest I can get, but the "struct" keyword is still missing in the forward declaration. One thing to note here is that when I fix the code generated by adding the struct keyword, when I synchronize the package again, a new tagged value named "type" is added. This tagged value however is nowhere to be found in the documentation. Does anyone know how to get the code templates to consider this then? Otherwise, I would say it's bug in EA.