﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
4009	Array types defined with type are not dealt with correctly in external functions	Francesco Casella	Martin Sjölund	"Consider this simple test case
{{{
model M
  type T = Real [3];

  Real x;

  function f
    input Real x;
    input T t_in;
    output Real y;
    external ""C"";
  annotation(Include = 
    ""
    #include <stddef.h>
    double f(double x, const double *t_in, size_t t_in_size)
    {
    return x + t_in[0] + t_in[1] + t_in[2];
    }
    "");
  end f;

equation
  x = f(time,{1, 2, 3}); 
end M;
}}}

When compiling it, you get this error:
{{{
M_functions.c:17:12: error: too few arguments to function 'f'
   _y_ext = f(_x_ext, (const double*) _t_in_c89);
}}}

Since T is actually an array, according to the Modelica Specification, section 12.9, the above function call should have an extra argument of type size_t containing the size of the array. Apparently, the type declaration masks this information in the code generation."	defect	closed	high	1.11.0	Run-time		fixed		gianluca.bardaro@… luca.bascetta@…
