http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61069

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Your code is invalid and the compiler can do anything. Note that if you type
bar as you should, gfortran complains:

! { dg-do compile }
program foo
  implicit none
  integer :: i, bar
  external bar, baz

  i = 0
  call bar(i)
!  print *, bar(i)
  call baz(i)
end program

gives

pr61069_3.f90:4.19:

  integer :: i, bar
                   1
Error: FUNCTION attribute conflicts with SUBROUTINE attribute in 'bar' at (1)
pr61069_3.f90:4.19:

  integer :: i, bar
                   1
pr61069_3.f90:8.13:

  call bar(i)
             2
Error: 'bar' at (1) has a type, which is not consistent with the CALL at (2)

Reply via email to