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

ID | Project | Category | View Status | Date Submitted | Last Update
0002139 | Part 01: TTCN-3 Core Language | Technical | public | 12-10-2007 16:14 | 12-03-2008 10:27

Reporter | Roland Gecse |
Assigned To | Thomas DeiÃŸ |
Priority | normal | Severity | minor | Reproducibility | N/A
Status | closed | Resolution | won't fix |
Platform |  | OS |  | OS Version |
Product Version | v3.2.1 (published 2007-02) |
Target Version | v3.3.2 (published 2008-04) | Fixed in Version | v3.3.2 (published 2008-04) |
Clause Reference(s) | 6.2, C.29
Source (company - Author) | L.M.Ericsson

Summary | 0002139: Forbid partial values in initializers

Description

TTCN-3 allows for leaving certain elements of structured type values undefined at initialization. There are three cases when this can happen:
1) Excluding certain elements when using the value assignment notation, e.g.:
type record r { integer i optional, boolean b };
var r v_r1 := { b := true };
2) Explicitly marking the omission of some elements using the not used symbol in value assignment notation, e.g.:
var r v_r2 := { a := -, b := true };
3) Specifying undefined elements with the not used symbol in value list notation, e.g.:
var r v_r3 := { -, true };
Cases 1-3 result partial values, which are incomplete because these contain an unbound element.
The recommendation is to forbid users to create partial values deliberately. Partial values should only be accepted as a consequence of some operations (e.g. indexing, assignment).
Reasoning:
A) De-referring a partial value is illegal and should cause error. For successful execution the missing unbound element must be set to contain some valid value anyway. The entire value content could be set at that time w/o the need of a partially pre-initialized value.
B) If using partial value cannot be avoided -- with serious doubts if this could happen at all -- the user could still use assignments to set those fields, which need to have some value. E.g.:
var r v_r4;
v_r4.b := true; // partial value as consequence of assignment -> ok
C) Incomplete values raise some issues related to other language constructions, such as sizeof, too. According to section C.29 the unbound value at the end of a record of/set of value does not count into the length, e.g.:
type record of integer roi;
var roi v1 := {1}, v2 := {1,-}, v3 := {1,-,-};
What is the relationship between v1, v2 and v3? Are these all equal?
Yes? Why do we have the not used symbols at the end?
No? Don't these all have the same length and elements?
I believe it would be very beneficial to cut this feature from TTCN-3 as it contributes to bad programming practices.

Steps To Reproduce |
Additional Information |
Tags | No tags attached.
Relationships |
Attached Files |

Issue History
Date Modified | Username | Field | Change
12-10-2007 16:14 | Roland Gecse | New Issue |
12-10-2007 16:14 | Roland Gecse | Clause Reference(s) | => 6.2, C.29
12-10-2007 16:14 | Roland Gecse | Source (company - Author) | => L.M.Ericsson
13-10-2007 19:03 | Ina Schieferdecker | Status | new => assigned
13-10-2007 19:03 | Ina Schieferdecker | Assigned To | => developer_u
17-10-2007 12:41 | user10 | Assigned To | developer_u => Thomas DeiÃŸ
18-10-2007 12:09 | Ina Schieferdecker | Target Version | => Edition 3.3.1 (not yet published)
03-12-2007 12:38 | Jens Grabowski | Note Added: 0004228 |
04-12-2007 16:59 | Thomas DeiÃŸ | Status | assigned => closed
04-12-2007 16:59 | Thomas DeiÃŸ | Resolution | open => won't fix
12-03-2008 10:27 | user10 | Fixed in Version | => Edition 3.3.2 (not yet published)
12-03-2008 10:27 | user10 | Target Version | Edition 3.3.1 --will not be published, see 3.3.2 => Edition 3.3.2 (not yet published)

Notes

(0004228)
Jens Grabowski
03-12-2007 12:38

Nothing shall change. The CR will be rejected.