To: J3 J3-01/324 From: Larry Meadows Subject: BOZ constants Date: August 21, 2001 BOZ constants were promoted to full-fledged integer constants in the F2K draft. This causes many existing codes, that use a common extension to treat BOZ constants as typeless, to fail. For example, on an IEEE machine, consider the following code: REAL R R = Z'3F800000' PRINT *,R END The above code is illegal F95. On many existing compilers it will print 1.0 . In F2K it will print the integral value in decimal of 3F800000 . It has been suggested that the transfer intrinsic can be used to mimic the defacto-standard behavior of existing compilers. However, the transfer intrinsic cannot be used in DATA statements, forcing the user to resort to equivalence or other subversion. Also, the use of BOZ constants as typeless in existing code is often in legacy code, and the user will not wish to modify such code. This paper proposes that BOZ constants be disallowed in most contexts, so that the defacto-standard behavior can continue to exist as a vendor extension. Edits: [32:41+] Insert constraint: Constraint: A /boz-literal-constant/ shall not appear except in the following contexts: 1) in a DATA statement where it corresponds to an integer variable, 2) as an /initialization-expr/ in a /type-declaration-stmt/ where the data entity being initialized is an integer data entity. 3) as an /initialization-expr/ in a PARAMETER statement where the named constant is an integer named constant, 4) as the /expr/ in an intrinsic assignment statement where the /variable/ is an integer variable, 5) as an /expr/ in a structure constructor that corresponds to an integer component of the derived type, and 6) as an /expr/ that is an /ac-value/ in an array constructor that contains at least one /ac-value/ that is an integer /expr/ and is not a /boz-literal-constant/.