ETSI's Bug Tracker - Part 01: TTCN-3 Core Language
View Issue Details

ID | Project | Category | View Status | Date Submitted | Last Update
0007148 | Part 01: TTCN-3 Core Language | Technical | public | 19-08-2015 12:48 | 11-12-2015 15:00

Reporter | Tomas Urban |
Assigned To | Gyorgy Rethy |
Priority | normal | Severity | minor | Reproducibility | have not tried
Status | closed | Resolution | fixed |
Platform |  | OS |  | OS Version |
Product Version | v4.7.1 (published 2015-06) |
Target Version | v4.8.1 (published 2016-07) | Fixed in Version | v4.8.1 (published 2016-07) |
Clause Reference(s) | 21.3.2
Source (company - Author) | STF 487

Summary | 0007148: Parameters of functions started as PTC behaviour

Description

The section 21.3.2 on starting test components doesn't say much about out and inout parameters. There's no restriction on them, so they seem to be allowed. The only text concerning these parameters can be found in the note 2: "Possible return values of a function invoked in a start test component operation, i.e. templates denoted by return keyword or inout and out parameters, have no effect when the started test component terminates."
There are several problems connected with that. The first problem is obvious - this text should not be in the note as it has all attributes of a mandatory rule.
The second problem is related to the principle of passing inout parameters by reference. This principle was introduced in recent specifications and I think the implications on the start call were not considered. Allowing to pass references this way would lead to shared variables and I think this is not a desired effect. Ports, defaults and timers are forbidden to be passed exactly for the same reason.
In my opinion, it should be either completely disallowed to use inout parameters in fuctions invoked in the start call (which is unfortunately not a backwards compatible solution) or there should be a rule saying that the actual inout parameters are passed by value in this case.
The third problem is connected with the out parameters. Since the actual parameter is not assigned when the test component terminates (as described in the note 2), there's a question why the actual parameter should be present at all. In my opinion, TTCN-3 should allow to skip actual out parameters (see the related CR) and this notation can be either recommended (in a note, backwards compatible) or mandatory (leads to better code, but not backwards compatible).

Steps To Reproduce |
Additional Information |
Tags | technically agreed

Relationships

related to | 0007149 | closed | Gyorgy Rethy | Allow to skip actual out parameters

Attached Files | CR7148_resolution_v1.docx (79,106) 25-09-2015 10:50 http://oldforge.etsi.org/mantis/file_download.php?file_id=3288&type=bug CR7148_resolution_v2.docx (80,916) 25-09-2015 12:20 http://oldforge.etsi.org/mantis/file_download.php?file_id=3289&type=bug CR7148_resolution_v3.docx (80,776) 25-09-2015 12:43 http://oldforge.etsi.org/mantis/file_download.php?file_id=3290&type=bug

Issue History
Date Modified | Username | Field | Change
19-08-2015 12:48 | Tomas Urban | New Issue |
19-08-2015 12:56 | Tomas Urban | Note Added: 0013172 |
21-08-2015 11:03 | Jacob Wieland - Spirent | Note Added: 0013176 |
21-09-2015 10:27 | Gyorgy Rethy | Target Version | => v4.8.1 (published 2016-07)
21-09-2015 16:23 | Gyorgy Rethy | Tag Attached: technically agreed |
21-09-2015 16:26 | Gyorgy Rethy | Note Added: 0013226 |
21-09-2015 16:30 | Gyorgy Rethy | Relationship added | related to 0007149
21-09-2015 16:31 | Gyorgy Rethy | Note Edited: 0013226 | bug_revision_view_page.php?bugnote_id=13226#r169
24-09-2015 12:41 | Axel Rennoch | Assigned To | => Axel Rennoch
24-09-2015 12:41 | Axel Rennoch | Status | new => assigned
25-09-2015 10:50 | Axel Rennoch | File Added: CR7148_resolution_v1.docx |
25-09-2015 10:52 | Axel Rennoch | Note Added: 0013302 |
25-09-2015 10:53 | Axel Rennoch | Assigned To | Axel Rennoch => Jacob Wieland - Spirent
25-09-2015 10:53 | Axel Rennoch | Status | assigned => feedback
25-09-2015 11:07 | Jacob Wieland - Spirent | Note Added: 0013303 |
25-09-2015 12:20 | Jacob Wieland - Spirent | File Added: CR7148_resolution_v2.docx |
25-09-2015 12:21 | Jacob Wieland - Spirent | Note Added: 0013307 |
25-09-2015 12:21 | Jacob Wieland - Spirent | Assigned To | Jacob Wieland - Spirent => Axel Rennoch
25-09-2015 12:21 | Jacob Wieland - Spirent | Status | feedback => confirmed
25-09-2015 12:43 | Axel Rennoch | File Added: CR7148_resolution_v3.docx |
25-09-2015 12:46 | Axel Rennoch | Note Added: 0013309 |
25-09-2015 12:46 | Axel Rennoch | Status | confirmed => resolved
25-09-2015 12:46 | Axel Rennoch | Resolution | open => fixed
25-09-2015 12:46 | Axel Rennoch | Assigned To | Axel Rennoch => Gyorgy Rethy
04-11-2015 14:03 | Gyorgy Rethy | Fixed in Version | => v4.8.1 (published 2016-07)
11-12-2015 15:00 | Gyorgy Rethy | Note Added: 0013596 |
11-12-2015 15:00 | Gyorgy Rethy | Status | resolved => closed

Notes

(0013172)
Tomas Urban
19-08-2015 12:56

Unfortunately I don't have rights to add the related CR, so I link it this way: 0007149

(0013176)
Jacob Wieland - Spirent
21-08-2015 11:03

Basically, the semantics of out and inout parameters of started functions should be changed so that inout parameters are treated like in-parameters (i.e. the value of the given actual parameter is copied because in/inout parameters need to be partially initialized) and out actual parameters are basically treated like an anonymous variable (to which the result-value is assigned and subsequently forgotten).
This would preserve the existing semantics of "no effect" in existing code.

(0013226)
Gyorgy Rethy
21-09-2015 16:26 (edited on: 21-09-2015 16:31)

STF discussion: note shall be mandatory text. More explicit statement is needed that when starting a function, inout parameters shall be handled like in parameters (i.e. passed by value). Out prrameters may optionally be skipped (see CR 7149)

(0013302)
Axel Rennoch
25-09-2015 10:52

Initial ideas in resolution v1 uploaded.

(0013303)
Jacob Wieland - Spirent
25-09-2015 11:07

The sentences should be put in the Semantic Description part as they are not really restrictions, but just describe what is allowed for out parameters and what happens for inout and out parameters.

(0013307)
Jacob Wieland - Spirent
25-09-2015 12:21

changed the text, moved to Semantic description parts and added further clarifications. please review

(0013309)
Axel Rennoch
25-09-2015 12:46

This final version just delete unnecessary characters and clean the formatting.

(0013596)
Gyorgy Rethy
11-12-2015 15:00

Added to draft V4.7.4