public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/29652]  New: ambiguous interface declaration undetected
@ 2006-10-30 14:55 franke dot daniel at gmail dot com
  2006-10-31  5:41 ` [Bug fortran/29652] " pault at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: franke dot daniel at gmail dot com @ 2006-10-30 14:55 UTC (permalink / raw)
  To: gcc-bugs

The following code has an ambiguous interface, sub_a and sub_b are identical.
This is correctly reported as an error, if sub_a/sub_b are the only procedures
listed. Adding a third and different overload to the interface (sub_c), the
ambiguity in sub_a/sub_b goes undetected. 

$> cat iface.f90
MODULE mod
INTERFACE iface
  MODULE PROCEDURE sub_a
  MODULE PROCEDURE sub_b
  MODULE PROCEDURE sub_c
END INTERFACE
CONTAINS
  SUBROUTINE sub_a(x)
    INTEGER, INTENT(in) :: x
    WRITE (*,*) 'A: ', x
  END SUBROUTINE
  SUBROUTINE sub_b(y)
    INTEGER, INTENT(in) :: y
    WRITE (*,*) 'B: ', y
  END SUBROUTINE
  SUBROUTINE sub_c(x, y)
    REAL, INTENT(in) :: x, y
    WRITE(*,*) x, y
  END SUBROUTINE
END MODULE

PROGRAM test_interface
  USE mod
  CALL iface(42)
END PROGRAM

$> gfortran-svn -g -Wall iface.f90 && ./a.out
 B:           42

$> gfortran-svn -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../../svn/gcc/configure --prefix=$(localpath) --disable-nls
--enable-threads=posix --enable-shared --enable-bootstrap --with-system-zlib
--program-suffix=-svn --enable-languages=c,c++,fortran
Thread model: posix
gcc version 4.3.0 20061030 (experimental)


-- 
           Summary: ambiguous interface declaration undetected
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: franke dot daniel at gmail dot com
  GCC host triplet: i686-pc-linux-gnu


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-11-23 19:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-30 14:55 [Bug fortran/29652] New: ambiguous interface declaration undetected franke dot daniel at gmail dot com
2006-10-31  5:41 ` [Bug fortran/29652] " pault at gcc dot gnu dot org
2006-11-15 18:25 ` patchapp at dberlin dot org
2006-11-15 18:58 ` pault at gcc dot gnu dot org
2006-11-22  0:02 ` pault at gcc dot gnu dot org
2006-11-23 19:14 ` pault at gcc dot gnu dot org
2006-11-23 19:18 ` pault at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).