J3/13-312r3 To: J3 From: Van Snyder Subject: Specifications for US-08 -- explicit specification of EXTERNAL Date: 2013 October 16 Reference: 13-244r1, N1982 1. Requirements =============== Currently, there is no way to require explicit specification of the external attribute. Providing such a means would aid program checking. 2. Specification ================ Provide a means of requiring explicit declaration of the EXTERNAL attribute for external and dummy procedures. This characteristic shall be inherited by scoping units the same way that the implicit mapping is inherited. There shall be no means to override this characteristic in a nested scope. 3. Syntax ========= Allow an optional ( EXTERNAL ) annotation after IMPLICIT NONE, meaning that no references to implicitly external procedures are allowed. For consistency allow IMPLICIT NONE (TYPE) for disabling implicit typing, and IMPLICIT NONE(TYPE,EXTERNAL) to do both in one statement. <> IMPLICIT <> IMPLICIT NONE [ ( [ implicit-none-spec-list ] ) ] <> EXTERNAL <> TYPE 4. Edits to 10-007r1 ==================== [Introduction p2+] In the new list of new features, insert a list item: " o Programs and procedures: An IMPLICIT NONE statement can require explicit declaration of the EXTERNAL attribute throughout a scoping unit and its contained scoping units. " [109:2] Replace second alternative of . " <> IMPLICIT NONE [ ( [ ] ) ]" [109:4+] Insert new BNF "R562a <> EXTERNAL <> TYPE" [109:6] C582, delete "and there ... scoping unit" and append "No more than one IMPLICIT NONE statement shall appear in a scoping unit.". [109:6+] Insert constraint "If an IMPLICIT NONE statement in a scoping unit has an of TYPE or has no , there shall be no other IMPLICIT statements in the scoping unit.". {If the sole IMPLICIT NONE statement is "IMPLICIT NONE(EXTERNAL)", i.e. implicit typing is still allowed, this allows other IMPLICIT statements to appear.} [109:7+] Insert constraints "C583a If IMPLICIT NONE with an of EXTERNAL appears within a scoping unit, the name of an external or dummy procedure in that scoping unit or in a contained subprogram or BLOCK construct shall be explicitly declared to have the EXTERNAL attribute.". [109:14] p3, After "IMPLICIT NONE" insert "with an of TYPE or with no ". {Give semantics of IMPLICIT NONE(TYPE) and maintain default.} ===END===