This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: module usage and interfaces, bug?
- From: Daniel Franke <franke dot daniel at gmail dot com>
- To: fortran at gcc dot gnu dot org, ferretti dot andrea at unimore dot it
- Date: Mon, 15 Jan 2007 20:09:53 +0100
- Subject: Re: module usage and interfaces, bug?
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:from:to:subject:date:user-agent:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id; b=l/ZO0ipqIfzrwoYAE2WeTSdzJKHTMds5PdK6nr8Ekq/LyciL2Tkx+8KMmZClnkraRqIz49E8Z4OZfeP/ghwQ7vXHieGYPSzuGosdcaC8jqdg54g1uQ/Q18VzVUEQqxUohtWIYQLPjN/icxy+yq+9CzBp7Ev7E8o7g6HLlixA7Bc=
- References: <Pine.LNX.4.58.0701151928440.3513@bamboo.fisica.unimo.it>
On Monday 15 January 2007 19:53, Andrea Ferretti wrote:
> gfortran seems not able to compile the following chain files, which I
> think should be compliant with the standard (at least as far as I know).
> Thanks in advance for the help.
> the compilation stops with a failure when compiling main.f90
> giving the error:
>
> Name 'hello' at (1) is an ambiguous reference to 'hello' from module
> 'interf_module'
Andrea,
Paul Thomas recently spent quite some time fixing loads of interface-related
bugs (see meta-bug PR29670), therefore gfortran's handling of some code may
have changed.
Here's another example which is reported as erronuous:
$> cat iface.f90
MODULE mod_foo
INTERFACE
FUNCTION foo()
INTEGER :: foo
END FUNCTION
END INTERFACE
END MODULE
function foo()
USE mod_foo
INTEGER :: foo
foo = 42
END function
$> gfortran-svn -c -g -Wall -Wimplicit-interface -fimplicit-none iface.f90
iface.f90:12.16:
INTEGER :: foo
1
Error: Name 'foo' at (1) is an ambiguous reference to 'foo' from current
program unit
iface.f90:13.5:
foo = 42
1
Error: Name 'foo' at (1) is an ambiguous reference to 'foo' from current
program unit
iface.f90:10.12:
function foo()
1
Error: Function 'foo' at (1) has no IMPLICIT type
The Intel and Lahey compilers report similar issues, SUN accepts it (but gives
a unrelated message if compiled with -ansi enabled).
Thus I assume gfortran's behaviour to be correct.
Regards
Daniel