Opened 8 years ago

Last modified 6 years ago

#4055 closed defect

A problem with complex numbers — at Initial Version

Reported by: massimo ceraolo Owned by: Lennart Ochel
Priority: critical Milestone: 1.14.0
Component: Code Generation Version:
Keywords: Cc:

Description

The following simple model compiles but does not run:

model ComplexTest
  parameter Integer n = 3;
  Complex Z[n];
  constant Complex j = Complex(0, 1);
algorithm
  for i in 1:n loop
    Z[i] := 1 + j;
  end for;
end ComplexTest;

Here's the error message:


ComplexTest.c: In function 'ComplexTest_eqFunction_2':
ComplexTest.c:143:7: warning: implicit declaration of function '$PZ$lB' [-Wimplicit-function-declaration]

$PZ$lB(modelica_integer)$Pi$rB$Pre = tmp1._re;

ComplexTest.c:143:14: error: expected expression before 'modelica_integer'

$PZ$lB(modelica_integer)$Pi$rB$Pre = tmp1._re;


ComplexTest.c:143:31: error: expected ';' before '$Pi$rB$Pre'

$PZ$lB(modelica_integer)$Pi$rB$Pre = tmp1._re;


ComplexTest.c:144:14: error: expected expression before 'modelica_integer'

$PZ$lB(modelica_integer)$Pi$rB$Pim = tmp1._im;


ComplexTest.c:144:31: error: expected ';' before '$Pi$rB$Pim'

$PZ$lB(modelica_integer)$Pi$rB$Pim = tmp1._im;


Tested with OpenModelica v1.11.0-dev-16-g6312752

Change History (0)

Note: See TracTickets for help on using tickets.