J3/01-136r1 Date: 12-Apr-2001 To: J3 From: interp/Stan Whitlock Subj: Interp #88 ---------------------------------------------------------------------- NUMBER: 000088 TITLE: INTRINSIC statement and attribute KEYWORDS: intrinsic DEFECT TYPE: Erratum STATUS: J3 consideration in progress QUESTION: Is it possible for a variable or external procedure that has the same name as the specific name of an intrinsic function listed in section 13.13 of the Fortran 95 standard and not marked with a bullet to be used as an actual argument? For example, consider the following program: module SCREEN type :: COLOR integer :: RED, GREEN, BLUE end type COLOR contains subroutine SET_BACKGROUND ( WHAT ) type(color), intent(in) :: WHAT ! Call to set the background color end subroutine SET_BACKGROUND end module SCREEN program TEST_SCREEN use SCREEN real, external :: DIM character(len=15) :: SIGN real :: SIN type(color) :: TAN = color(210,180,140) call color_intensity ( dim ) call biblical ( sign ) call cardinal ( sin ) call set_background ( tan ) end program TEST_SCREEN Notice that the actual arguments have the names of specific intrinsic functions listed in section 13.13 of the Fortran 95 standard, but they do not appear in an INTRINSIC statement, nor are they given the INTRINSIC attribute in a type declaration statement, as required by the penultimate normative paragraph of 12.3.2.3 of the Fortran 95 standard [198:7-9]. ANSWER: The answer to the question in the first paragraph is yes. Fortran has no reserved words. In the scope of the above main program, none of the names DIM, SIGN, SIN and TAN are names of intrinsic procedures. The paragraph referenced reads: If the specific name of an intrinsic function (13.13) is used as an actual argument, the name shall either appear in an INTRINSIC statement or be given the INTRINSIC attribute in a type declaration statement in the scoping unit. and tells us that SIN does not refer to the intrinsic procedure. The names DIM, SIGN, and TAN can be indentified from their declarations not to be intrinsic procedures. Since none of the names are those of intrinsic procedures, the paragraph does not affect their use as the names of actual arguments. The edit makes the meaning clearer. EDIT: Page 198, Subclause 12.3.2.3, replace lines 7-9 of page 198 [198:7-9] by 'If a specific intrinsic function (13.13) is used as an actual argument, it shall have been explicitly declared to have the INTRINSIC atrtribute.' SUBMITTED BY: Van Snyder HISTORY: 00-249 m154 Submitted 01-136r1 m156 Passed unanimously by J3 meeting