X3J3/96-132r1

From: Loren P. Meissner

Subject: Extend Initialization Expressions

Meeting 138

<FORTREQ>

<NUMBER>

<TITLE> Permit Type Conversion Functions in Initialization Expressions (was: Extend Initialization of COMPLEX Variables)

<KEYWORDS> Initialization, Type Conversion

<STATUS> Registered

<TARGET>

<SUBGROUP>

<VERSION> 3

<REQUIREMENT>

In an initialization expression, permit a reference to one of the intrinsic functions INT, REAL, DBLE, or CMPLX, where each argument is an initialization expression.

</REQUIREMENT>

<JUSTIFICATION>

In applications, it frequently happens that a particular numerical value is required for initialization with more than one intrinsic numeric type. The current standard requires that the constant be rewritten for each different type. This can lead to programming errors.

</JUSTIFICATION>

<SUGGESTED IMPLEMENTATION>

Extend the definition of "Initialization Expression" by adding after item 7(e) in 7.1.6.1 on page 94 the following additional item:

(f) one of the conversion functions INT, REAL, DBLE, or CMPLX

</SUGGESTED IMPLEMENTATION>

<ESTIMATED IMPACT>

Improved program reliability for certain applications that require initializations with the same numerical value but with more than one intrinsic numeric type.

</ESTIMATED IMPACT>

<SUBMITTED BY>

Loren Meissner

2 Kerr Ave

Kensington CA 94707

LPMeissner@msn.com

</SUBMITTED BY>

<HISTORY>

<EVENT> February 1996, meeting 136; submitted 96-042

<EVENT> May 1996, meeting 137

<EVENT> August 1997, meeting 138; X3J3 approved 8-4

</HISTORY>

</FORTREQ>