CNES / ccsdsmo-malc-stubgenerator

Stub Generator for CCSDS MAL C API
https://cnes.github.io/ccsdsmo-malc
MIT License
3 stars 2 forks source link

Generated code from COM area does not compile #2

Closed gbonnefille closed 7 years ago

gbonnefille commented 7 years ago

While trying to generate the C stubs from MO services, we encounter problems on the code generated from the COM area.

/home/dev/MOL/MO_applications/c_prototypes/src/com/include/com.h:77:127: erreur: unknown type name ‘com_activitytracking_activityacceptance_list_t’
 int com_event_monitorevent_update_add_encoding_length_1_com_activitytracking_activityacceptance_list(mal_encoder_t * encoder, com_activitytracking_activityacceptance_list_t * element, void * cursor);
                                                                                                                               ^
/home/dev/MOL/MO_applications/c_prototypes/src/com/include/com.h:78:129: erreur: unknown type name ‘com_activitytracking_activityacceptance_list_t’
 int com_event_monitorevent_update_encode_1_com_activitytracking_activityacceptance_list(void * cursor, mal_encoder_t * encoder, com_activitytracking_activityacceptance_list_t * element);
                                                                                                                                 ^

The related generated code is:

int com_event_monitorevent_update_add_encoding_length_1_com_activitytracking_activityacceptance_list(mal_encoder_t * encoder, com_activitytracking_activityacceptance_list_t * element, void * cursor);
int com_event_monitorevent_update_encode_1_com_activitytracking_activityacceptance_list(void * cursor, mal_encoder_t * encoder, com_activitytracking_activityacceptance_list_t * element);

Looking at this code, it appears that the generated function uses a type declared later in the file.

lacourte commented 7 years ago

The issue as been fixed in latest commit. However an issue still remains with abstract types and multi area projects.

lacourte commented 7 years ago

Fixed in previous commits.