To: J3 Members J3/16-196 From: Van Snyder Subject: Kind type parameters for intrinsic types References: 16-007r1 Date: 2016 May 23 1. Introduction =============== The descriptions of kind type parameters in 4.4 are inconsistent. Some have constraints against being negative, in addition to a constraint requiring the value that specifies a representation method that exists on the processor. Since SELECTED_INT_KIND etc. return a negative result if there is no kind that satisfies the requirements, one might infer that a processor is not allowed to use a negative value for a valid kind type parameter. As far as I can tell, this is not a requirement. Some kind type parameters are required (by parenthetical remarks, not constraints) to be of default kind, while others are not. Kind type parameters for derived types are explicitly allowed by R432 and 4.5.3.1p2. These requirements should be consistent, and should be consistently described. Notes 4.5 and 4.8 illustrate using a constant as a type parameter in a literal constant. This should not be encouraged, or even suggested. 2. Edits ======== [xviii intro under "Data declaration"] Insert "Requirements on kind type parameters for intrinsic types are regularized. Processors are prohibited to use a negative kind type parameter value to specify a representation method for an intrinsic type." [52:5 4.2p2] Before "A kind" insert "The value of a kind type parameter that specifies a representation method for an intrinsic type shall not be negative." unless the requirement appears elsewhere. In addition to simplifying a few constraints, it is necessary so that a processor does not choose -1 as a valid representation method for SELECTED_INT_KIND(4). [55:15 C412 Delete "shall be nonnegative and" because the constraint also requires the value to be one that specifies a representation method for the processor, and a value that specifies a representation method for the processor cannot be negative. [56:7 C414] Delete C414 because the syntax of , which is constrained by C414, is , not , i.e., it does not include a sign, C415 requires the value to be one that specifies a representation method for the processor, and a value that specifies a representation method for the processor cannot be negative. [56:11+8 NOTE 4.5] Delete "1976354279568241_8" because it militates against portability. We shouldn't encourage inferior programming practices. [57:26+6 NOTE 4.8] Delete "-16.4E8" because it militates against portability. We shouldn't encourage inferior programming practices. [58:6 4.4.3.3p2] Delete "(default integer)". This requirement does not appear for INTEGER or REAL type, nor is the in R409 constrained to be of default kind. If it is needed, it ought to be a constraint in clause 5. One might argue that it follows from the syntax for , which does not include a kind parameter, but applies only to literal constants. [59:8 4.4.3.3p2] Delete "(default integer)" for the same reason as at [58:6]. [59:12 4.4.3.3p2] Replace "occur" with "appear". "Occur" is an active event, while "appear" is a condition. [59:37 C419] Delete "shall be nonnegative and" because the constraint also requires the value to be one that specifies a representation method for the processor, and a value that specifies a representation method for the processor cannot be negative. [62:12 4.4.5p2] Delete "(default integer)" for the same reason as at [58:6].