This issue tracker is closed. Please visit UPPAAL issue tracker at Github instead.

Bug 238 - Problems with struct parameters in templates
Summary: Problems with struct parameters in templates
Alias: None
Product: UPPAAL
Classification: Unclassified
Component: libutap (show other bugs)
Version: 3.6 Alpha 2
Hardware: PC Windows 2000
: P1 minor
Assignee: Gerd Behrmann
Depends on:
Reported: 2005-12-07 11:31 CET by Martin Instenberg
Modified: 2005-12-07 18:30 CET (History)
0 users

See Also:

test case (661 bytes, text/xml)
2005-12-07 11:32 CET, Martin Instenberg

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Instenberg 2005-12-07 11:31:44 CET
Due to the syntax description of Uppaal it should be possible to pass structs to
templates as parameters.
When I try to do this I get "Incompatible argument" in the Process assignment.

I'm using the alpha3-pre1.
Comment 1 Martin Instenberg 2005-12-07 11:32:41 CET
Created attachment 80 [details]
test case
Comment 2 Gerd Behrmann 2005-12-07 11:38:52 CET
As for the particular testcase, the argument is indeed incompatible, since UPPAAL uses name equivalence 
rather than structural equivalence for type checking structures. The correct approach is to use a typedef to 
assign a name to the structure.

However, even when using a typedef, UPPAAL complains about an incompatible type (unless call by 
reference is used).
Comment 3 Martin Instenberg 2005-12-07 12:22:16 CET
Seems that Uppaal always complains about incompatible argumenbts when call by
value is used.
Comment 4 Gerd Behrmann 2005-12-07 14:08:53 CET
Actually, UPPAAL was right even when using call by value: For call by value the argument of course needs 
to be a constant.  Everything is ok if the system is redeclared as:

typedef struct{int a;} T;
const T str1 = { 1 };
process P(T rec) {...}

However, I wil not close this bug: When even I get fooled, then the error messages must be improved :-) . I 
did reduce the severity, though.
Comment 5 Gerd Behrmann 2005-12-07 18:30:02 CET
The error message for non-constant arguments to value template parameters has been fixed on the trunk 
(revision 1335).