﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
3198	ParModelica fails to build model calling print due to invalid conversion	Gustaf Thorslund	Mahder Alemseged Gebremedhin	"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)
"	defect	closed	high	1.9.4	ParModelica	trunk	fixed	ParModelica	
