To: J3 J3/20-137 From: Richard Bleikamp Subject: UTI-15 Date: 2020-September-30 Reference: 20-122r1 Background: In F202x, the list of variables described below are now assigned values with intrinsic assignment semantics, which will, for deferred length allocatable character variables, often require deallocating the variable (if allocated) and allocating it with the "appropriate" length for the value to be assigned. In F2018, these variables were assigned a value with appropriate truncation or blank padding using the existing allocated storage/length. Character variables affected (if deferred len, and allocatable) - those specified in IOMSG= and ERRMSG= clauses, - those passed into certain intrinsic routines (DATE_AND_TIME, EXECUTE_COMMAND_LINE, GET_COMMAND, GET_COMMAND_ARGUMENT, GET_ENVIRONMENT_VARIABLE), and - those used as the unit in an internal WRITE statement. Here's an example that has a different interpretation under F2018 than F202x. program uti15 character (len=:), allocatable :: msg allocate(character(len=100)::msg) write(msg, "('this is a test')") ! F202x reallocates msg write(*,*) msg(99:99) ! a blank under F2018, zero length ! value under F202x end Edits to address UTI-15 (against 20-011) follow. {4.3.3} [27:21-23], replace that paragraph with these new paragraphs, and remove the Unresolved Technical Issue 015 note. ---------- start of replacement paragraphs Except as identified in this subclause, this document is an upward compatible extension to the preceding Fortran International Standard, ISO/IEC 1539-1:2018 (Fortran 2018). A standard-conforming Fortran 2018 program remains standard-conforming under this document. The following Fortran 2018 feature may have a different interpretation under this document. After an allocatable deferred length character variable is assigned a value in an IOMSG= or ERRMSG= clause, as the unit in an internal WRITE statement, or as an INTENT(OUT) argument in an intrinsic subroutine, that variable may be of shorter or longer length under this document than under Fortran 2018, since this document specifies intrinsic assignment semantics for these assignments. ---------- end of replacement paragraphs