Opened 10 years ago

Closed 10 years ago

Last modified 7 years ago

#2808 closed defect (fixed)

Codegen Error for strings in zero-crossings

Reported by: Willi Braun Owned by: Willi Braun
Priority: high Milestone: 1.9.4
Component: Code Generation Version: trunk
Keywords: Cc:

Description

For example, the following model fails with code generation issue, since strings are not escaped in the c code.

loadString("
model test
function compare
  input String string1;
  input String string2;
  input Boolean caseSensitive=true;
  output Boolean result;
external \"C\" result = ModelicaStrings_compare(string1, string2, caseSensitive) annotation(Library=\"ModelicaExternalC\");
end compare;
  Real x;
equation
  der(x) = if compare(\"test\",\"Test\",false) and x > 0.5 then 0.5 else 1.0;
end test;
");
simulate(test);
getErrorString();

Change History (4)

comment:1 by Willi Braun, 10 years ago

Owner: changed from Lennart Ochel to Willi Braun
Status: newaccepted

comment:2 by Willi Braun, 10 years ago

Resolution: fixed
Status: acceptedclosed
Version 0, edited 10 years ago by Willi Braun (next)

comment:3 by Dietmar Winkler, 9 years ago

Milestone: Futurepre1.9.4

It doesn't make sense to keep closed ticket in the "Future" milestone that were simply forgotten to assign to the correct milestone in the past.

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

Milestone: pre1.9.41.9.4

Removing the pre1.9.4 milestone in favor of 1.9.4.

Note: See TracTickets for help on using tickets.