This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Namespace question


Tobias Burnus wrote:
but gfortran complains:
    namelist /ops/ my
                1
Error: PROCEDURE attribute conflicts with NAMELIST attribute in 'my' at (1)

Who is right? I'm inclined to claim that gfortran is wrong. Especially
since the error only occures when "namespace" is present.

---------------
program main
  implicit none
contains
  subroutine my
  end subroutine my
  subroutine bar
    integer :: my
    namelist /ops/ my
  end subroutine bar
end program main
---------------

Gfortran is wrong. The INTEGER declaration in BAR declares MY as a local variable, thus overriding the host association of MY as the subroutine from the main program. Thus, as far as NAMELIST is concerned, this is an ordinary integer variable.


I seem to recall that there have been weird glitches with host association before; this is presumably just more of the same.

- Brooks


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]