J3/16-217 To: J3 Members From: Daniel Chen Subject: Editorial: EXTERNAL in INTERFACE body Date: 2016 June 05 Reference: 16-007r1 ---------------------------------------------------------------------- QUESTION: Consider the following code. program main real ext, inval interface function ext1 (y) real ext1, y external ext1 end function ext1 ! Duplicate EXTERNAL attribute end interface inval = 1.0 print *, ext1(inval) end program main The EXTERNAL statement is allowed inside an interface body. However, we have a constraint as: [16-007: p118] C542 In an external subprogram, the EXTERNAL attribute shall not be specified for a procedure defined by the subprogram. It only mentions 'external subprogram'. Should it also include interface body to be consistent? ANSWER: The code is not standard conforming. Edit is provided to clarify it. EDITS to 16-007r1: [16-007r1:p99] add a new constraint after C542 C542a In an interface body, the EXTERNAL attribute shall not be given to the procedure other than the function-stmt or the subroutine-stmt. SUBMITTED BY: Daniel Chen HISTORY: yy-nnn ----------------------------------------------------------------------