#2556 closed defect (fixed)
Support qualified component references in external function definitions
Reported by: | Adrian Pop | Owned by: | Adrian Pop |
---|---|---|---|
Priority: | high | Milestone: | 1.9.1 |
Component: | Frontend | Version: | trunk |
Keywords: | Cc: | c.schulze@…, Francesco Casella |
Description
Currently the specification says that:
Spec 12.9:
"The only permissible kinds of expressions in the argument list are identifiers, scalar constants, and the function
size applied to an array and a constant dimension number. The annotations are used to pass additional information
to the compiler when necessary."
But some libraries use qualified component references i.e. crit.d
in the external function definition. We should support it but
issue a warning.
Change History (6)
comment:1 by , 11 years ago
Owner: | changed from | to
---|---|
Status: | new → accepted |
comment:2 by , 11 years ago
comment:3 by , 11 years ago
Cc: | added |
---|
comment:4 by , 11 years ago
m:#351 suggests this might be supported. But it does not have any text on what the actual changes will be...
comment:5 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
Fixed in r20049. No warning is issued since spec 3.3rev1 will allow this.
comment:6 by , 11 years ago
Note that the testcase does not consider records where the elements are not in lexical order (or contain arrays that need to be removed):
model QualifiedCrefArg record R Real y; Real x; end R; impure function f input R ri = R(x=1.0, y=2.0); output R r; external "C" r.y = f_ext(ri.x, ri.y, r) annotation(Library = "QualifiedCrefArg-f.o"); end f; R r1 = f(R(x=3.0, y=2.0)); R r2 = f(); end QualifiedCrefArg;
Gives results different from (with the original C-file):
model QualifiedCrefArg record R Real x; Real y; end R;
The easiest way would be to just add dummy protected temp variables bound to the qualified variables.