Error when compiling using gcc440 (compiles fine with gcc412) - missing actual arg:

Error when compiling using gcc440 (compiles fine with gcc412) - missing actual arg:

Post by Tobias Bur » Tue, 15 Dec 2009 22:05:29



Are you sure that you call with "gcc412" also dtime and not (some
external) fdtime? I am asking because my GCC/gfortran 4.1.2 prints the
same error message as your gcc440 or my GCC 4.5.0.


The error message also makes perfectly sense if one looks at the
documentation of "dtime" at
http://www.yqcomputer.com/

(Even g77 has the same syntax:
http://www.yqcomputer.com/
)

Reading the documentation, one finds out that "dtime" exists in
g77/gfortran both as function and as subroutine. The subroutine version
takes two arguments - and not just one.

I quickly checked some other compilers and those seem only to support
the function version - with the same syntax as gfortran. Thus I wonder
with which compiler "call dtime(timeee)" actually worked.

If you look at the gfortran documentation [first link], you will see
that at the bottom there is a reference to CPU_TIME. Unless you need to
support quite old compilers, you should consider to switch to CPU_TIME
as this intrinsic is well defined (part of the Fortran 95/2003[/2008
draft] standard [but not in Fortran 77 or 90]) - and thus works with all
Fortran 95 compilers, which are widely used.

Tobias