Opened 11 years ago
Closed 5 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)
Change History (5)
by , 11 years ago
| Attachment: | Modele_stockage_Pia.mo added |
|---|
by , 11 years ago
| Attachment: | Modele_stockage_Pia.Tests_2.Tests_composants.Test_KO_05evt.c added |
|---|
comment:1 by , 11 years ago
| Component: | Code Generation → OMEdit |
|---|---|
| Milestone: | Compiler Redesign → Future |
| Owner: | changed from to |
| Priority: | normal → high |
| Summary: | Error in C code generated by OMedit → 2 models that work separately, but not when put together |
comment:2 by , 11 years ago
| Component: | OMEdit → Code Generation |
|---|---|
| Owner: | changed from to |
| Status: | new → assigned |
comment:3 by , 5 years ago
| Milestone: | Future → 1.16.0 |
|---|---|
| Resolution: | → fixed |
| Status: | assigned → closed |
This seems to have been fixed at some point, the model now simulates successfully.

This is a code generation bug not OMEdit.