This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: hooking a new intrinsic subroutine?
- From: Paul Brook <paul at codesourcery dot com>
- To: fortran at gcc dot gnu dot org
- Cc: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- Date: Sun, 18 Apr 2004 19:20:36 +0100
- Subject: Re: hooking a new intrinsic subroutine?
- Organization: CodeSourcery
- References: <20040418045858.GA50423@troutmask.apl.washington.edu>
On Sunday 18 April 2004 05:58, Steve Kargl wrote:
> Gang,
>
> Are there any simply to follow rules on hooking up a new
> intrinsic subroutine to gfortran? I have the guts of
> date_and_time() implemented and system_time() will be
> done shortly. I was going to emulate how random_seed()
> and random_number() are implemented, but unfortunately
> these procedures are broken on FreeBSD.
Last time I looked we didn't handle optional arguments in intrinsic
subroutines properly. Specifically we don't pass the character length
parameters for absent optional arguments.
My preferred solution would be to fix this (no particular ideas how, sorry),
and resolve each of the two intrinsics you mention to a single library call.
The alternative would be to resolve to different library calls based on the
presence/absence of arguments. This has the potential to get really ugly if
we start adding extra character based intrinsic subroutines, so I'd prefer
not to go this route.
Paul