Opened 10 years ago

Closed 4 years ago

#2912 closed defect (fixed)

2 models that work separately, but not when put together

Reported by: anonymous Owned by: lochel, wbraun
Priority: high Milestone: 1.16.0
Component: Code Generation Version: trunk
Keywords: Cc:

Description

I have 2 models that work fine, but when I put them together, I get an error, even with no link whatsoever between the 2 first models. (I've also tested the model with Dymola and it works fine).
OMedit error message:


Modele_stockage_Pia.Tests_2.Tests_composants.Test_KO_05evt.c: In function 'Modele_stockage_Pia_Tests_2_Tests_composants_Test_KO_zeroCrossingDescription':
Modele_stockage_Pia.Tests_2.Tests_composants.Test_KO_05evt.c:65: warning: assignment discards qualifiers from pointer target type


Upon investigation, the c file generated by OMedit has an error.
The code looks like this :
"static const int *occurEqs[]= occurEqs0,occurEqs1,occurEqs2,occurEqs3};
*out_EquationIndexes = occurEqs[i];"
instead of maybe something like this :
"static const int *occurEqs[]={occurEqs0,occurEqs1,occurEqs2,occurEqs3};
static const int *out_EquationIndexes = occurEqs[i];"
(I don't know anything about C, so that's just a guess)
You can find my model attached to this message, and the problematic C file.

Attachments (2)

Modele_stockage_Pia.mo (43.4 KB ) - added by anonymous 10 years ago.
Modele_stockage_Pia.Tests_2.Tests_composants.Test_KO_05evt.c (16.3 KB ) - added by anonymous 10 years ago.

Download all attachments as: .zip

Change History (5)

by anonymous, 10 years ago

Attachment: Modele_stockage_Pia.mo added

comment:1 by anonymous, 10 years ago

Component: Code GenerationOMEdit
Milestone: Compiler RedesignFuture
Owner: changed from Lennart Ochel to Adeel Asghar
Priority: normalhigh
Summary: Error in C code generated by OMedit2 models that work separately, but not when put together

comment:2 by Adeel Asghar, 10 years ago

Component: OMEditCode Generation
Owner: changed from Adeel Asghar to lochel, wbraun
Status: newassigned

This is a code generation bug not OMEdit.

comment:3 by Per Östlund, 4 years ago

Milestone: Future1.16.0
Resolution: fixed
Status: assignedclosed

This seems to have been fixed at some point, the model now simulates successfully.

Note: See TracTickets for help on using tickets.