Opened 12 years ago

Closed 11 years ago

#2009 closed defect (fixed)

Code generation fails when array of a record is passed to a function

Reported by: Christian Schubert Owned by: Martin Sjölund
Priority: normal Milestone: 1.9.0
Component: Code Generation Version: trunk
Keywords: code generation record array function Cc: Jens Frenkel

Description

Hi,

I have a problem with Code generation when passing arrays of records to a function as in this simple test model:

model RecordArrayInFunction
  record Record
    Real x[4];
  end Record;

  function fun
    input Record u[2];
    output Real y;
  algorithm
    y :=sum(u[1].x) + sum(u[2].x);
  end fun;

  Record r[2](each x = 1:4);
  Real z;

equation
  z = fun(r);
end RecordArrayInFunction;

gcc fails because the type 'RecordArrayInFunction_Record_array' is not defined.

Attachments (2)

RecordArrayInFunction.mo (308 bytes ) - added by anonymous 12 years ago.
RecordArrayInFunction.mos (87 bytes ) - added by anonymous 12 years ago.

Download all attachments as: .zip

Change History (4)

by anonymous, 12 years ago

Attachment: RecordArrayInFunction.mo added

by anonymous, 12 years ago

Attachment: RecordArrayInFunction.mos added

comment:1 by Mahder Alemseged Gebremedhin, 11 years ago

Fixed in r16536.

comment:2 by Mahder Alemseged Gebremedhin, 11 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.