Re: gfortran & directory routines
- From: Mike Prager <mprager@xxxxxxxxxxxxxxxxx>
- Date: Thu, 18 Aug 2011 14:46:22 -0700
On Thu, 18 Aug 2011 14:31:15 -0700, Mike Prager
<mprager@xxxxxxxxxxxxxxxxx> wrote:
On Thu, 18 Aug 2011 08:46:05 -0400, nospam@xxxxxxxxxxxxx (Richard[...]
Maine) wrote:
That seems slightly odd. I can understand requiring declarations of the
function return types (assuming they are indeed functions instead of
subroutines). But it seems odd to require the external declaration. I
might go so far as to say that it sounds like a violation of the
standard. Unless there are both external and intrinsic procedures of the
same name, you should not need an explicit external or intrinsic
declaration. Declaring it the wrong way can hurt (i.e. declaring it as
an external when the compiler has it as an intrinsic), but omitting the
intrnsic and external declarations should be fine unless you are doing
some of the slightly rare things where they happen to be required
(notably, passing them as actual arguments).
Don't blame the compiler. It has the functions in a supplied library,
and with "implicit none", it required me to declare the return types.
I added the "external" designator on my own.
Well, maybe I spoke too soon. Compilation fails without the external
attribute. The declaration is in the top level of a module. The
functions are used in various contained module procedures.
Some of the code looks like this:
module fileutils
use strutils, only : strtrans
implicit none
integer, external :: getcwd, chdir
contains
!---------------------------------------------------------------------------------------------
subroutine fullpathMM(filename_in, fullname, ierror)
! Given a file name, returns the full path with all
! path separators converted to "/"
implicit none
character(len=*), intent(IN) :: filename_in
character(len=*), intent(OUT) :: fullname
character(len=512) :: filename, curdir, filedir
integer, intent(OUT) :: ierror
integer :: dummy, i
logical :: file_exists
.
- Follow-Ups:
- Re: gfortran & directory routines
- From: Richard Maine
- Re: gfortran & directory routines
- References:
- gfortran & directory routines
- From: Mike Prager
- Re: gfortran & directory routines
- From: Steven G. Kargl
- Re: gfortran & directory routines
- From: Mike Prager
- Re: gfortran & directory routines
- From: Richard Maine
- Re: gfortran & directory routines
- From: Mike Prager
- gfortran & directory routines
- Prev by Date: Re: gfortran & directory routines
- Next by Date: Re: Need a FORTRAN compiler for Win7 (or XP)
- Previous by thread: Re: gfortran & directory routines
- Next by thread: Re: gfortran & directory routines
- Index(es):
Relevant Pages
|