Summary: | Problems with struct parameters in templates | ||
---|---|---|---|
Product: | UPPAAL | Reporter: | Martin Instenberg <instenberg> |
Component: | libutap | Assignee: | Gerd Behrmann <behrmann> |
Status: | RESOLVED FIXED | ||
Severity: | minor | ||
Priority: | P1 | ||
Version: | 3.6 Alpha 2 | ||
Hardware: | PC | ||
OS: | Windows 2000 | ||
Architecture: | |||
Attachments: | test case |
Description
Martin Instenberg
2005-12-07 11:31:44 CET
Created attachment 80 [details]
test case
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). Seems that Uppaal always complains about incompatible argumenbts when call by value is used. 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) {...} Q=P(str1); 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. The error message for non-constant arguments to value template parameters has been fixed on the trunk (revision 1335). |