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

Bug 238

Summary: Problems with struct parameters in templates
Product: UPPAAL Reporter: Martin Instenberg <instenberg>
Component: libutapAssignee: Gerd Behrmann <behrmann>
Severity: minor    
Priority: P1    
Version: 3.6 Alpha 2   
Hardware: PC   
OS: Windows 2000   
Attachments: test case

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).