Opened 19 years ago

Last modified 14 years ago

#33 closed defect (invalid)

Returning unassigned output values

Reported by: davbr Owned by: davbr
Priority: critical Milestone:
Component: Interactive Environment Version: 1.4.5
Keywords: Cc: davbr, davbr

Description

See comment

Change History (2)

comment:1 by davbr, 19 years ago

If a function is returning an integer value, but the output value has never been
assigned a value, a strange value of -138191724 is returned. See test case
func_multiple_return.mos

comment:2 by Martin Sjölund, 14 years ago

MSL 3.2 sec. 12.2:

The local variables of a function are not automatically initialized to the implicit default values of the data type (Section 12.4.4) [(e.g. 0.0 for Real) for performance reasons. It is the responsibility of the user to provide explicit defaults or to define the values of such variables before they are referenced.]

The only part of MSL that I can find that could possibly require output variables to be set if they are not defined is the fact that Modelica functions are pure (section 12.3).

Note: See TracTickets for help on using tickets.