This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/61069] Gfortran allows functions to be called as subroutines when defined in a separate source file
- From: "dominiq at lps dot ens.fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 05 May 2014 22:33:39 +0000
- Subject: [Bug fortran/61069] Gfortran allows functions to be called as subroutines when defined in a separate source file
- Auto-submitted: auto-generated
- References: <bug-61069-4 at http dot gcc dot gnu dot org/bugzilla/>
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)