Opened 8 years ago

Last modified 6 years ago

#4055 closed defect

A problem with complex numbers — at Version 1

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

Description (last modified by massimo ceraolo)

The following simple model compiles but does not run:

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

Here's the error message:


ComplexIssue.Test.c: In function 'ComplexIssue_Test_eqFunction_2':
ComplexIssue.Test.c:143:7: warning: implicit declaration of function '$PZ$lB' [-Wimplicit-function-declaration]

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

ComplexIssue.Test.c:143:14: error: expected expression before 'modelica_integer'

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


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

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


ComplexIssue.Test.c:144:14: error: expected expression before 'modelica_integer'

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


ComplexIssue.Test.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 (1)

comment:1 by massimo ceraolo, 8 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.