[Bug fortran/52333] Explicit etime interface should work

sgk at troutmask dot apl.washington.edu gcc-bugzilla@gcc.gnu.org
Wed Feb 22 04:17:00 GMT 2012


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

--- Comment #5 from Steve Kargl <sgk at troutmask dot apl.washington.edu> 2012-02-22 03:49:15 UTC ---
On Wed, Feb 22, 2012 at 03:32:14AM +0000, pablomme at googlemail dot com wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52333
> 
> --- Comment #3 from pablomme <pablomme at googlemail dot com> 2012-02-22 03:32:14 UTC ---
> > Please define fails.  What is the error message you get?
> 
> Namely:
> 
> $ gfortran -o t test_etime_iface.f90 
> /scratch/pl275/ccyZ7sWC.o: In function `MAIN__':
> test_etime_iface.f90:(.text+0x4b): undefined reference to `etime_'
> collect2: ld returned 1 exit status
> 
> gfortran accepts the inteface but ld fails because the intrinsic has been
> obscured by a missing external procedure.

Well, obscured may be misleading.  gfortran's intrinsic 
procedure is named _gfortran_etime.  When you give the
interface block, gfortran is clearly treating this as
an external procedure.  I'm still reading through Sec. 12
of F2008 to see if this is the expected behavior.

> > As it is an intrinsic procedure, etime already has an
> > explicit interface.  So, trying to re-specify
> > an interface makes no sense.
> 
> I don't doubt that gfortran's behaviour may be sensible.
> The "bug" here is that it behaves differently from 6 other compilers.

Well, the other compilers do not make a very striction
distinction between an intrinsic and external procedure
for procedures that are supplied with the compiler but
are not listed in the standard.  gfortran is very consistent
with how it treats precedures it supplies in its runtime
library.

> About whether this construction makes sense or not, in our code we use this
> explicit interface in order to support optional compilation of a C replacement
> for etime for compilers that do not offer the extension. At present, gfortran
> requires the C replacement because of this problem, but it shouldn't need it.
> No biggie, of course, but it'd be nice to see this consistency.

What happens with all your compilers if you supply
an explicit interface for say DSIN.



More information about the Gcc-bugs mailing list