Opened 10 years ago

Closed 9 years ago

Last modified 8 years ago

#3198 closed defect (fixed)

ParModelica fails to build model calling print due to invalid conversion

Reported by: gustaf Owned by: mahge930
Priority: high Milestone: 1.9.4
Component: ParModelica Version: trunk
Keywords: ParModelica Cc:

Description

Given the following model:

model PrintTest
algorithm
  when sample(0, 0.1) then
    print ("Time: " + String(time) + "\n");
  end when;
end PrintTest;

Try to build it with ParModelica:

$ omc -s -g=ParModelica PrintTest.mo 
class PrintTest
algorithm
  when sample(0.0, 0.1) then
    print("Time: " + String(time, 0, true, 6) + "
    ");
  end when;
end PrintTest;

Then compilation fails with:

$ make -f PrintTest.makefile 
g++   -fPIC -O0 -falign-functions -march=native     -I"/home/gustaf/local/openmodelica/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME  -c -o PrintTest.o PrintTest.c
In file included from /home/gustaf/local/openmodelica/include/omc/c/openmodelica_func.h:44:0,
                 from PrintTest.c:5:
/home/gustaf/local/openmodelica/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}
                                                                       ^
PrintTest_12jac.h:2:51: note: in expansion of macro ‘omc_dummyRealAttribute’
 static const REAL_ATTRIBUTE dummyREAL_ATTRIBUTE = omc_dummyRealAttribute;
                                                   ^
/home/gustaf/local/openmodelica/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}
                                                                       ^
PrintTest_12jac.h:2:51: note: in expansion of macro ‘omc_dummyRealAttribute’
 static const REAL_ATTRIBUTE dummyREAL_ATTRIBUTE = omc_dummyRealAttribute;
                                                   ^
/home/gustaf/local/openmodelica/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}
                                                                       ^
PrintTest_12jac.h:2:51: note: in expansion of macro ‘omc_dummyRealAttribute’
 static const REAL_ATTRIBUTE dummyREAL_ATTRIBUTE = omc_dummyRealAttribute;
                                                   ^
<builtin>: recipe for target 'PrintTest.o' failed
make: *** [PrintTest.o] Error 1

$ omc --version
1.9.2+dev (r24991)

Change History (5)

comment:1 Changed 10 years ago by perost

  • Component changed from Frontend to ParModelica
  • Owner changed from somebody to mahge930

Seems we didn't have a ParModelica component in Trac before. Fixed :)

comment:2 Changed 9 years ago by mahge930

  • Resolution set to fixed
  • Status changed from new to closed

comment:3 Changed 9 years ago by dietmarw

  • Milestone changed from Future to 1.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:4 Changed 8 years ago by sjoelund.se

  • Milestone changed from 1.9.4 to 1.9.4-1.9.x

Milestone renamed

comment:5 Changed 8 years ago by sjoelund.se

  • Milestone changed from 1.9.4-1.9.x to 1.9.4

Milestone renamed

Note: See TracTickets for help on using tickets.