Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#3315 closed defect (fixed)

ParModelica generating broken code for minimal testcase

Reported by: Gustaf Thorslund Owned by: Mahder Alemseged Gebremedhin
Priority: high Milestone: 1.9.4
Component: ParModelica Version: trunk
Keywords: regression Cc: Adrian Pop

Description

class null
end null;
build$ omc -g=ParModelica ../null.mo -s
class null
end null;
build$ make -f null.makefile 
g++   -fPIC -O0 -falign-functions -march=native     -I"/home/gustaf/src/OpenModelica/build/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME  -c -o null.o null.c
In file included from /home/gustaf/src/OpenModelica/build/include/omc/c/openmodelica_func.h:44:0,
                 from null.c:5:
/home/gustaf/src/OpenModelica/build/include/omc/c/simulation_data.h:48:71: error: invalid conversion from ‘const void*’ to ‘modelica_string {aka void*} [-fpermissive]
 #define omc_dummyRealAttribute {"","","",DBL_MAX,DBL_MIN,0,0,1.0,0,0.0}
                                                                       ^
null_12jac.h:2:51: note: in expansion of macro ‘omc_dummyRealAttribute’
 static const REAL_ATTRIBUTE dummyREAL_ATTRIBUTE = omc_dummyRealAttribute;
                                                   ^
/home/gustaf/src/OpenModelica/build/include/omc/c/simulation_data.h:48:71: error: invalid conversion from ‘const void*’ to ‘modelica_string {aka void*} [-fpermissive]
 #define omc_dummyRealAttribute {"","","",DBL_MAX,DBL_MIN,0,0,1.0,0,0.0}
                                                                       ^
null_12jac.h:2:51: note: in expansion of macro ‘omc_dummyRealAttribute’
 static const REAL_ATTRIBUTE dummyREAL_ATTRIBUTE = omc_dummyRealAttribute;
                                                   ^
/home/gustaf/src/OpenModelica/build/include/omc/c/simulation_data.h:48:71: error: invalid conversion from ‘const void*’ to ‘modelica_string {aka void*} [-fpermissive]
 #define omc_dummyRealAttribute {"","","",DBL_MAX,DBL_MIN,0,0,1.0,0,0.0}
                                                                       ^
null_12jac.h:2:51: note: in expansion of macro ‘omc_dummyRealAttribute’
 static const REAL_ATTRIBUTE dummyREAL_ATTRIBUTE = omc_dummyRealAttribute;
                                                   ^
<builtin>: recipe for target 'null.o' failed
make: *** [null.o] Error 1

Test case same as closed #3190, while error appears to be same/similar to #3198.

Some kind of minimal regression tests for ParModelica would really be useful, to avoid bugs like this one...

Change History (7)

comment:1 by Adrian Pop, 10 years ago

Owner: set to Mahder Alemseged Gebremedhin
Status: newassigned

comment:2 by Gustaf Thorslund, 10 years ago

Priority: blockerhigh

For the record, I've been told this is due to the simulation runtime being compiled as C++-code, since that's what's what's used in ParModelica, while it's only valid C-code. The workaround is to not do simulations from ParModelica, or to patch the simulation runtime.

I've changed priority from blocker to high.

comment:4 by Mahder Alemseged Gebremedhin, 9 years ago

Resolution: fixed
Status: assignedclosed

comment:5 by Dietmar Winkler, 9 years ago

Milestone: Future1.9.4

Sorting these closed tickets away from "Future". Since they were closed after the last 1.9.3 release, it's very likely that they should have been part of the 1.9.4 release.

comment:6 by Martin Sjölund, 9 years ago

Milestone: 1.9.41.9.4-1.9.x

Milestone renamed

comment:7 by Martin Sjölund, 9 years ago

Milestone: 1.9.4-1.9.x1.9.4

Milestone renamed

Note: See TracTickets for help on using tickets.